Eclipse Debugging Maven Test

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.