I'm working with a Java project in Intellij IDEA where we have a lot of internal, standalone, Maven dependencies. I have the source code for these dependencies imported into my IDEA project as modules, but when I select Go To -> Implementation(s) on a class that is part of an internal Maven dependency (and that I have also imported as a module in my project) I'm navigated to a decompiled view of the class in the Maven dependency (jar) and not the source code file of that class that I imported as a module.
To solve this I need to do the following:
Is there any way to have IDEA figuring out this automatically or do I have to do this manual procedure over and over?
To add another maven project (that is not part of your main project) as a dependency:
Source: https://www.jetbrains.com/idea/help/maven-projects-tool-window.html?search=maven%20project
I'd suggest that you are using intellij incorrectly in this example. If you are referring to your maven dependencies as intellij modules, it will get confused.
You should either:
Lets say you have a maven module A which has module B as a dependency. If you import both modules into one IntelliJ project, IntelliJ will automatically use the imported module B instead of the maven artifact from repository - but you must import it as a maven module.
If you then run some test or application via IntelliJ from module A, it will use it's own compiled classes from module B and not the maven artifact from repository, navigation in the code and everything else will work as expected.
If this does not work, then you should report a bug.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.