Server debug uses Maven repository sources instead of actual codebase

Answered

I'm using IDEA 2016.1.3, but I've been running into similar issues from IDEA 15 and on.

Every time we do a Maven install there's an artifact created using the sources plugin called <artifact-name-version>-sources.jar.

When I debug server deployed code, IDEA takes that artifact to debug (step) from the M2 repo instead of my actual class in my IDE.  I would prefer to use my actual codebase instead of Maven artifact sources.  I can't seem to find a way to get this done.

 

I asked about something similar some time ago:

https://intellij-support.jetbrains.com/hc/en-us/community/posts/206152859-IDEA-15-Debug-disable-alternative-source-

So I disabled the choice dialog as I don't want to be choosing a file every time I debug.  It's time wasting, irritating and it gets me out of my thought flow.

 

Any suggestions?

3 comments
Comment actions Permalink

What I have to do every time I do a Maven build is either disable the sources plugin (it's there for a reason) or delete the latest build from my local M2 repository.  

Every time...  It's not exactly user friendly.

0
Comment actions Permalink

Hi, what kind of dependency do you have on the installed artifact?

If possible provide a project structure (or a sample project to reproduce).

Thanks!

0
Comment actions Permalink

Sorry for the lateness, I was in holiday.

The dependency is just a regular one with scope compile.  I can't provide you with a project structure, I'm not allowed to do so.  However to reproduce I suggest the following:

Server is JBoss EAP 6.2 started as IDEA run/debug configuration in standalone mode.  There are NO deployments specified in that run configuration, I don't want code swap.  Every time I do a deploy it's done using a Maven command.  

When new code is deployed and a break point is triggered in debug mode IDEA opens the sources in the mvn repo instead of using the code in IDEA.  The mvn command is "mvn clean install" with a profile for deployment which attaches the 'deploy' goal from the jboss-as-maven-plugin to the install phase.  As said, every build has the 'jar' goal from the maven-source-plugin attached to the package phase.  So this means that when the install command is done, the sources-jar is also installed to the local repository.  

 

0

Please sign in to leave a comment.