Maven 2 & 3

Enable remote debugging command line option (+ docs)

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 2.0.2
  • Fix Version/s: 2.0.8
  • Component/s: Command Line
  • Labels:
    None
  • Complexity:
    Intermediate
  • Number of attachments :
    0

Description

[dev list mailing reference: Debugging maven with breakpoints feed-back: --jdwp + docs]

Problem:
Currently its hard to enable remote debugging for a remote debugger of your IDE.
Basically you need to set MAVEN_OPTS something like:
export MAVEN_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"
mvn ...
and unset it again.

Solution:

1) Make it easier, choices:
A) Provide a command line option to do this (--debug is already taken for debug logging), choices:
a) mvn --jdpa
b) mvn --jdwp
B) Provide a different script: mvnDebug
to avoid parsing command line arguments in bat and shell
C) Find a generic way to give options on the command, like -mx etc to the java process, possibly by namespacing them?

2) Document it in mvn --help

3) Document it on http://maven.apache.org/guides/development/guide-m2-development.html
like so (APT):

Debugging with breakpoints

You can attach a remote debugger of your IDE to the maven process.
This will allow you to set breakpoints (line, exception, ...).

Start maven in debugger mode on port 8000:

+--
mvn ??? install
+--

If you want to change any of the debugger settings,
use MAVEN_OPTS instead.

Then connect to the correct port with a remote debugger in your IDE.

Issue Links

Activity

Show
Barrie Treloar added a comment - For now http://docs.codehaus.org/display/MAVENUSER/Dealing+with+Eclipse-based+IDE contains notes.
Hide
Brian Fox added a comment -

added mvnDebug scripts

Show
Brian Fox added a comment - added mvnDebug scripts

People

Vote (4)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: