Debugging in Maven?

If you are using Maven 2.0.8+, run the mvnDebug command in place of mvn and attach a debugger on port 8000.

For Maven <2.0.8, uncomment the following line in your %M2_HOME%/bin/mvn.bat (and maybe save the modified version as mvnDebug.bat):

@REM set MAVEN_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000

More details in MNG-2105 and Dealing with Eclipse-based IDE.

Leave a Comment