Debugging the wrong MAVEN dependency?

So here is my project hierarchy.

               |____JarA - snapshot version 2

               |____JarA - released version 1

I have ApplicationA, ApplicationB, and JarA 2-snapshot source in my workspace.

When I deploy both ApplicationA and ApplicationB to Tomcat in debug, I seem to step into the wrong version of JarA. When I access ApplicationA, I expect to be stepping through JarA snapshot version. IntelliJ is dropping me in the released version of JarA, which is a dependency from the ApplicationB chain (external libraries).

Does this make sense? I have confirmed that my parent pom for ApplicationA is depending on the snapshot version of JarA, which is opened in my workspace for workspace resolution.

Windows XP, Intellij 12, Maven 3, JDK 6

1 comment
Permanently deleted user

Hi Gary,

IDEA's debugger searches for sources starting from the module that is specified in the Run Configuration used to initiate debugging. So the search classpath will be classpath of the speciefied module and all modules it depends on, recursively. When the class is found, IDEA determines the source of this class: this is either a library of a class that corresponds to the output directory of some project's module. If the class was found in some library, debugger then looks up sources, attached to this library. If corresponding source is found, it is opened in the editor, otherwise you will see a decompiled stub of this class.
So to answer the question why this particular source is shown in the editor, please check the classpath of the module that is specified in your Tomcat run configuration (the order corresponds to the order you see in Dependencies tab in module's properties UI page).



Please sign in to leave a comment.