Using intellij and maven pom files, how do i debug tests run inside the maven test goal?
When i run them directly in the code, it complains something about profiles missing, which i've ticked inside intellij's Maven Projects.
Debug failed tests If you don't know why a test fails, you can debug it. In the editor, click the gutter on the line where you want to set a breakpoint. There are different types of breakpoints that you can use depending on where you want to suspend the program. For more information, refer to Breakpoints.
Just enter a command like this - >mvn -Dtest=TestClassName#methodname -Dmaven.surefire.debug test. It will start listening to 5005 port. Now just create a remote debugging in Eclipse through Debug Configurations for localhost(any host) and port 5005.
http://maven.apache.org/plugins/maven-surefire-plugin/examples/debugging.html
-DforkMode=never
-DforkCount=0
In IDEA, open your run/debug configuration, in Runner
tab, add fork options -DforkCount=0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With