Nuxeo Core Developer Guide

How to Debug a Test Run with Maven

Updated: January 2, 2020

Due to different class loading rules and test order, test results might change if you run them inside Eclipse or with Maven. Note however that such cases raise an issue in the way the tests are written.

Using Eclipse to debug tests run with Maven

To debug the MySuperClassTest class:

  1. Start the Maven test for this class only, in debug mode:

    mvn -Dtest=MySuperClassTest -Dmaven.surefire.debug test

    The test will wait for Eclipse to connect.

  2. Open the Debug Configuration in Eclipse and set up a remote application on port 5005. Run the configuration. The test will resume. You can use break points and all the usual features of Eclipse debugging.

More information is available on the maven-surefire-plugin page.


We'd love to hear your thoughts!

All fields required