It's a bit old thread but for the sake of completeness I though i might add a little here.
The plugin does not provide debug options configuration for whatever strange reason.
Thus your only option is to manually specify debug configuration to the JVM that runs the process.
In your environment, there are three ways achieve this:
- Using a well known-maven environment variable (as described by childno.de)
- Directly specifying the options to maven (no env. variable needed):
mvn -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y tomcat7:run-war
- With an eclipse Run configuration That's basically the same like 2) but you define this in eclipse (that would be good if you didn't want to leave the IDE at all).
To achieve that you need to specify a Maven Build Run configuration.
Set the goal to
tomcat7:run
(or similar) and then navigate to the JRE tab. The VM arguments area is where you specify the debug configuration: -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y
If you opt for 3), the precise run goal for tomcat7 is irrelevant to the debug enabling. Choose according to you use case (dynamic web project, war, etc.). Same goes for the plugin configuration. However, make sure to specify that you are using the tomcat maven plugin in the
pluginManagement
section of your project pom:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
</plugin>
</plugins>
</pluginManagement>