Maven: Debugging
Here you can find information on debugging.
Step 1: Set up your IDE
First you need to setup IDE. For details, see Configure Remote Debugging in IDEA or Configure remote debugging for Eclipse.
Configure Remote Debugging in IDEA
You'll want to create a configuration for Tomcat.
- Select Run -> Edit Configurations
- Click Add New Configuration
- Select Remote
- Name the Configuration
- Set the Port to 8787
- Uncheck Make in the Before Launch section
- Uncheck Display settings before launching
- Click Apply

Configure remote debugging for Eclipse
This is as simple as creating a Remote Java Application as a Debug Configuration.
- Drop down the Debug button, and choose Debug Configurations.
- Select Remote Java Application in the
Configurations list and click New
Configuration.
- Name the configuration.
- Specify the project to debug (web).
- Specify the port (8787).
- Click Apply.
- Click Debug.
To set up a debug configuration for your unit tests, specify 5005 as the port.
Step 2: Remotely debug tomcat
- Make sure you have a remote configuration for Tomcat to port 8787. Repeat the steps above for creating a remote debugger.
- Run this with
Maven:
mvn -Dcargo.wait=true -P int integration-test
- In IDEA, select the Runtime Configuration you created from the drop down in the tool bar.
- .
IDEA will connect to the Tomcat process and display the Debug view.
Maven: Debugging unit tests
Debugging unit tests is very simple with Maven and Surefire.
All you have to do is specify the maven.surefire.debug sytem property on the command line:
mvn -Dmaven.surefire.debug test
To specify a specific test use:
mvn -Dmaven.surefire.debug -Dtest=<unqualified-classname> test