On 12/14/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
"Barrie Treloar" <[EMAIL PROTECTED]> schrieb am 13.12.2006 01:47:02:

> Running mvn in debug mode so I can attach eclipse to the running
instance.

How do you do that?

Copy your mvn script to something like mvn-debug.{bat|.sh}

Then find the line like:
%MAVEN_JAVA_EXE% -Xdebug -Xnoagent
-Xrunjdwp:transport=dt_socket,address=9292,server=y,suspend=y
%MAVEN_OPTS% -classpath %CLASSWORLDS_JAR%
"-Dclassworlds.conf=%M2_HOME%\bin\m2.conf" "-Dmaven.home=%M2_HOME%"
org.codehaus.classworlds.Launcher %MAVEN_CMD_LINE_ARGS%

And insert the jdwp stuff I have there:
-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=9292,server=y,suspend=y

This creates the debug server on port 9292 and waits for a debug
session to arrive before starting.

I use eclipse, so I create new Remote Java Application debug configuration.
The only problem I have is that eclipse requires a project to be
associated with the debug session and that project may have a
different classpath than maven does.

e.g. I was debugging the maven-eclipse-plugin which depends upon the
2.0.1 maven core artifacts, but I am using maven 2.0.4 so when I visit
one of those classes the stack traces are correct but the code is not.
To work around this I think I need to temporarily change the plugin's
dependencies and recync eclipse (preferably with sources attached) and
then it should be 100% correct.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to