Inspired by https://stackoverflow.com/a/14853683/286795, I'm trying to remotely debug a Maven project using mvnDebug and IntelliJ. However, the execution doesn't stop on my breakpoints. To reproduce a simple Hello World example:
On the local machine:
git clone https://github.com/LableOrg/java-maven-junit-helloworld.git
cd java-maven-junit-helloworld
mvnDebug test
On the remote machine:
Open Hello.java, set a breakpoint at the line that says printer.println(HELLO);
Run->Debug...->Edit Configurations..., Add New Configuration->Remote
The tests will now run WITHOUT stopping at the breakpoint. Why?
05 On the General settings panel, under Debugging, select Off next to Remote debugging setting to disable remote debugging using Microsoft Visual Studio for the selected Azure App Services web application.
Terminate a debugger sessionClick the Stop button in the Debug tool window. Alternatively, press Ctrl+F2 and select the process to terminate (if there are two or more of them).
While running the mvnDebug
command, use -DforkMode=never
.
so your maven command will look like this:
mvnDebug -DforkMode=never -Dmaven.surefire.debug clean install
For more info on -DforkMode=never
, read here
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