Maven multi module project: source file resolution did not work
Answered
Hi,
i moved from Eclipse to IDEA 2019.1.2 Ultimate. After importing my Maven multi module project, following problems occured:
- Jumping to Java source in other module under the same parent via ctrl+click always opens the compiled class from .m2/repository instead of the source file
- I always have to compile the code manually with maven clean install - otherwise old versions from maven repository are deployed to tomcat
- hot code swap did not work
- many warnings and errors on unused classes, methods and missing Spring beans are shown
I'm using Maven 3.6, OpenJDK 11, Tomcat 9 and Spring Boot. The project contains one parent with around 40 sub modules, half of them Spring Boot modules assembled as WAR, with excluded tomcat dependency.
I have reimported the project multiple times using different settings with no success.
Any ideas?
Please sign in to leave a comment.
Hello,
> Jumping to Java source in other module under the same parent via ctrl+click always opens the compiled class from .m2/repository instead of the source file
We have related issue on YouTrack:https://youtrack.jetbrains.com/issue/IDEA-174839
> I always have to compile the code manually with maven clean install - otherwise old versions from maven repository are deployed to tomcat
Same here: https://youtrack.jetbrains.com/issue/IDEA-106162
Is it possible to reproduce the issue with any sample project and provide it for investigation?
I tracked the problem down to jgitver. If i exclude the jgitver extension, the workspace resolution works. Maybe the project version i used was a bit unusual: '0-managed-by-jgitver'. I set it to just "1.0.0" and it works better - now Intellij finds sources of sub modules.
>I set it to just "1.0.0" and it works better - now Intellij finds sources of sub modules.
For IDE to resolve dependency to a Maven module in project rather than to a jar library form a local Maven repository you need to have: