Skip to content

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

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

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
@snicoll snicoll self-assigned this Aug 7, 2026
@snicoll

snicoll commented Aug 7, 2026

Copy link
Copy Markdown
Member

Thanks for the PR but I don't think we should mix the two in the same attribute. I've been looking at this and would like to fix this differently. Please see the original issue for more details.

@snicoll snicoll closed this Aug 7, 2026
@snicoll snicoll added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 7, 2026
@snicoll snicoll removed their assignment Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: declined A suggestion or change that we don't feel we should currently apply

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

3 participants