Roy's Blog

On Software and Fish.

Debug Maven Test Goal With Intellij IDEA

| Comments

Making it possible to live-debug and add breakpoints to your code during a maven test goal in Intellij Idea, shouldn’t take more than a minute.

  1. Modify your pom to have the debug process fork:

  2. Next, configure your debug process. You reach that under Run > Edit Configuration and add a Remote debugger:

Maven debug remote intellij

  1. Once the above is configured, run the mvn test goal. It should pause, listening on port 5005…

  1. Now execute the remote debugger you configured earlier. It should attach on port 5005. If you don’t have any breakpoints, you should see the below. If you have breakpoints, obviously they will trigger…