Skip to content

Allow Maven run and start goals to use test classes#51100

Open
henriquejsza wants to merge 1 commit into
spring-projects:mainfrom
henriquejsza:gh-36115
Open

Allow Maven run and start goals to use test classes#51100
henriquejsza wants to merge 1 commit into
spring-projects:mainfrom
henriquejsza:gh-36115

Conversation

@henriquejsza

Copy link
Copy Markdown
Contributor

The Maven plugin's useTestClasspath parameter currently accepts a boolean and true only adds test-scoped dependencies. This means that the start goal cannot launch an application whose main class is in target/test-classes.

This updates the parameter to support OFF, DEPENDENCIES, and ALL. The legacy values false and true remain aliases for OFF and DEPENDENCIES, respectively. ALL adds target/test-classes before target/classes and includes test-scoped dependencies for both run and start. Unit and integration tests cover mode parsing, backwards compatibility, classpath ordering, and launching from test classes.

Closes gh-36115

Closes spring-projectsgh-36115

Signed-off-by: henriquejsza <henriquejsza@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spring-boot.run.useTestClasspath does not take target/test-classes in account

2 participants