Debugging maven Test in eclipse
In general, you cannot make myeclipse detect breakpoints in your program by using the following methods:
Maven test, Run as, project
Or
Maven test, Debug as, project
If you want eclipse to be able to debug breakpoints while executing MAVEN test, you need to set the following:
1, project, run as--Open run Dialog ...
2. Right-click the Maven Build option on the left side of the dialog box to create a new label
3. In the Main tab on the right, click Browse Workspace ... button, and select the name of the project you want to debug
4. Enter-dmaven.surefire.debug test in the Goals text field on the Main tab on the right
5, click the Apply button, click the Run button to perform breakpoint debugging
Note: During debugging, MAVEN outputs the contents of the console:
"Listening for transport dt_socket at address:5005"
This means that the breakpoint debugging feature is enabled, but you will find that there is no content output for a long time, because the line above is a hyperlink that requires you to click on it before you can continue, and then run to the breakpoint for debugging.
Okay, this debug setup is successful.
Additional Instructions:
1) If you need to modify the debug function of the listening port, you can enter the following in the 4th step:
-dmaven.surefire.debug= "-xdebug-xrunjdwp:transport=dt_ socket,server=y,suspend=y,address= 8000 -xnoagent-djava.compiler=none "test
Span style= "font-family: Song body; font-size:18px; " >2) The build process displays the message: Listening for transport dt_socket at address:5005. After you see this message, in Eclipse, in the Debug Configuration window, create a new remote Java Application,port set to 5005, and then click the "Debug" button. After that, the MVN command will continue down until the code that has the breakpoint is run, and you can debug the running code in Eclipse
3) when debug, display source not found
debug view
-"Select Edit Source Lookup Path
-" select Add
-"Select Java project
Select the appropriate project for OK