Maven Projects

Debugging Tests

Forked Tests

By default, Maven runs your tests in a separate ("forked") process. You can use the maven.failsafe.debug property to debug your forked tests remotely, like this:

mvn -Dmaven.failsafe.debug verify

The tests will automatically pause and await a remote debugger on port 5005. You can then attach to the running tests using Eclipse. You can setup a "Remote Java Application" launch configuration via the menu command "Run" > "Open Debug Dialog..."

If you need to configure a different port, you may pass a more detailed value. For example, the command below will use port 8000 instead of port 5005.