Click on Source hyperlink jumps to wrong source file

In our environment, we work maven centric: all iml files are generated by maven.
Our project contains lots of modules.
Each module contains its own libraries, which are in a lot of cases the artifacts of other modules.
so, at the end we have a module A which is using the artifact of module B
the library of module B in module A is defined with the jar (off course) but, has also a sources.jar (generated by maven)

when we run some tests in module A, and have a failrue (e.g. a NullPointerException in a class of moduleB), and we click in the stacktrace, it jumps to the sourcefile in the sources.jar of the library.

This behaviour seems logic, but it shouldn't be the case when we define Module dependencies (these dependencies on top in the ordering)

When these dependencies are defined, running the module A takes the own classes of moduleB instead of the artifact of module B.
I expect the same behaviour when navigating to the source files.

Is there a way to solve this ?

2 comments
Comment actions Permalink

Maybe check the other modules for having a dependency on the moduleB.jar instead of the moduleB itself. As far as I remember I've walked into this issue as well and found out that some other module (with an alfabetically 'smaller' name) had an incorrect dependency.

0
Comment actions Permalink

you're correct.
There are indeed other modules, which have the molduleB.jar as library, and not the module B as a moduleDependency.

problem is that we have tons of modules (around 130). The iml files are generated by maven and do not generate module dependencies. I manually create module dependencies for the modules where I'm working on.

I still think source navigation behavior should be the same as the classpath behavior.
My tests DO use my module classes (not the artifacts), so the source navigation should also use my module source.

0

Please sign in to leave a comment.