Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classpath scanning is not working with --patch-module #15476

Closed
eiswind opened this issue Dec 16, 2018 · 1 comment
Closed

Classpath scanning is not working with --patch-module #15476

eiswind opened this issue Dec 16, 2018 · 1 comment
Labels
for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid

Comments

@eiswind
Copy link

eiswind commented Dec 16, 2018

I try to run a simple WebMvcTest on the module path with maven.
My module is declared open, and requires all the spring modules on the compile path.
All the application stuff is on the module path, the test scope dependencies are on the classpath when maven surefire launches the test.
The maven approach to testing is adding the test classes to the module under test with --patch-module.

I see the following obstacles:
The test is not finding the @SpringBootConfiguration:
IllegalState Unable to find a @SpringBootConfig..

When I try to add an @ContextConfiguration manually, the ComponentScan does not find my RestController, so ComponentScan does not work either.

The application works otherwise fine on the module path, but testing is a must have to me.
From my observations so far I can only guess, that the resources are only searched on the folder that the test class is in. I put tracelevel on org.springframework.context.annotation and I did not see an attempt to scan the parent package of the test (where the SpringBootApplication lives).

So far I did not find any working example of a running spring test on the module-path, so I would really appreciate if someone could look into this. Please let me know if I can be of any assistance.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 16, 2018
@wilkinsona
Copy link
Member

Duplicates #13581 which led to SPR-16977.

@wilkinsona wilkinsona added status: invalid An issue that we don't feel is valid for: external-project For an external project and not something we can fix and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

3 participants