IntelliJ IDEA debugger skips breakpoints when debugging Maven tests
One solution would be to use remote debugging:
configure the surefire plugin:
<debugForkedProcess>true</debugForkedProcess>
;run the test (will wait for a remote debugger to connect)
- create and run a remote debug configuration in IntelliJ (will hit your breakpoint); the port to connect to is 5005.
Just disable the forked mode - something like this in your pom file (under project/build/plugins section):
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.14</version>
<configuration>
<forkMode>never</forkMode>
</configuration>
</plugin>