Search code examples
remote-debuggingmaven-tomcat-pluginjpda

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


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 ;)


Solution

  • $ 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