I am trying to debug Maven tests in IntelliJ IDEA. When I open IDEA's Maven Projects view and right-click on test goal, I get an option to debug it. Clicking it executes this goal but the execution never stops at any breakpoints. What am I missing?
EDIT:
I realized (a decade ago 😅) it is infinitely easier to run the tests via IntelliJ (right-click on the src/test/java
directory and Run Tests
) and call it a day then to run them via Maven and wrangle with the debugger. I highly recommend you do the same and forget this whole thing.
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)