I don’t trust debugging Maven unit tests straight using Eclipse’s JUnit plugin, sometime it’s buggy and the classpath don’t match with Maven.
Here’s how you can attach eclipse debugger straight from Maven process. First setup few breakpoints of the suspicious code as per normal, and setup a Maven run configuration like this:
When you run this configuration, Maven will halt right before unit tests are run:
Now create a Remote Java Application Debug configuration pointing to localhost port 5050
Happy debugging!