Friday 27 July 2007

Debug on Ant/Maven

When you run (for example) jetty from ant (or maven) and want to debug. Then you'll notice that jetty is not in its own process but in the actual ant/maven process. You can set all the jvmargs you want it will still not work. I'm here talking about the mortbay´s maven-jetty-plugin. This also contains the ant task.

The workaround is:
Ant:
execute ant with the setting "--execdebug" (ant runJetty --execdebug) . This will print the command to the console. Copy/paste/edit to a script (add the debug parameters -XDebug ...). Start this particular command from this script when you want to debug.


Maven:
Whenever you want to debug. set "export MAVEN_OPTS=", to enable debug. Do this on the command line or a script that starts the shell.


Obviously we are are now debugging entire maven/ant. If anyone has a better idea, let me know.

No comments: