Remote debug using m2 repo class instead of project class

I'm using IntelliJ Idea 11.1.4 EAP, but I retested the situation on 11.1.3 which has exactly the same behaviour.

We are working with a backend Jetty server which has a war loaded up.  This war is built using the Maven-assembly-plugin instead of the regular Maven way.

I set the Jetty server to accept remote debugging, set the remote debug settings up in IntelliJ and connected.  At first glace it's all good but then a certain class rather deep within our codebase needed to be debugged.  Instead of using the class that is actually on my project IntelliJ chose to use the Maven repository version, which is even in the wrong version.  There's another version of that class with a different version name that could be more correct as well.  But anyway.  I'd much rather like IntelliJ to choose a project class if available.

When I set the setting in Remote Debug "Search sources using the classpath of module" to the module that problematic class is in it works better.  But still...


Thanks for reading,
T

2 comments
Comment actions Permalink

Thomas,

when doing remote debug, you need to correctly specify module's classpath.
Without an example it is hard to say, what it going wrong with your project; could you, please, at least, describe the problematic module's dependencies - whuch dependencies you expect to be resolved from the project but are not?

0
Comment actions Permalink

There's a Core module which is parent of roughly 100 child modules.  One of those modules has the class I'm interested in, for debugging.  All of those have got version X.X.X-ff-SNAPSHOT from pom files.  That's on my IDEA side of the debugging.  There aren't much dependencies on our own artifacts, simply because it pretty much already has it.

Then there's a module called "Standalone" which has the same version in its Maven pom file.  This module has a dependency on Jetty and some other stuff, but also not on our Core module.  The reason for that is that this Standalone module is built using the Maven-assembly-plugin.  For some reason the original designers thought it would be great to pack all Core modules in a war module without having dependencies on them.  The Standalone module has a bootstrap which starts Jetty and deploys the assembled war into it, while also connecting to the database.  It's a "standalone" backend application.  The Jetty container is the side that is being debugged.

Now, when I specify any other modules classpath from the Core app in the remote debugger in IDEA except for the module that has the class then the IDE gives me a Core class from the M2 repo, which even has the wrong version number.  X.X.X-SNAPSHOT, so without the "ff".  All while the real Java file is actually on my classpath all the time.  So even if I specify the Core modules classpath I still get handed the wrong file by the IDE during remote debugging.

There are no dependencies incorrectly resolved by the Maven subssystem in IDEA.  No problems there.  There's only the debugging issue.

And might I add that I prefer version 11.1.4 EAP above 11.1.3.

0

Please sign in to leave a comment.