Classpath scanning is not working with --patch-module #15476
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
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.
The text was updated successfully, but these errors were encountered: