How to set agentlib property for mvn tomcat plugin (jpda)

childno͡.de picture childno͡.de · Sep 14, 2012 · Viewed 11k times · Source

Related to eclipse debug remote web application => How do I debug a remote application in my eclipse

How can I set / archive this in the mvn tomcat plugin? http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/tomcat7-maven-plugin/

The only thing that might help is setting systemProperty but that doesn't work for me ;/

Goal: let tomcat run on console via maven but enable remote debugging for different IDEs

(YES guys, we can run tomcat in Eclipse WTP! That's not the question ;)

Answer

childno͡.de picture childno͡.de · Sep 14, 2012
$ export MAVEN_OPTS=-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n
$ mvn tomcat7:run-war

^^ that's it, not cool (as it is not in POM) but it works

Source: http://aaronz-sakai.blogspot.de/2009/02/debugging-jetty-when-running-mvn.html