Maven Eclipse Debugging those Things

Source: Internet
Author: User

Maven is a good tool to manage, but for debugging with Eclipse, it should be remote debugging for Eclipse, and the steps and settings are as follows:

1, toolbar –> run–>external tools–>external Tools configurations, configured as follows

650) this.width=650; "title=" image "style=" border-top:0px; border-right:0px; border-bottom:0px; border-left:0px; Display:inline "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M01/54/6B/wKioL1SBxquThcN0AAGTY_ Cgip4356.jpg "" 632 "height=" 339 "/>

On the right side of the Environment tab, add the following variables:

Maven_opts =-xdebug-xnoagent-djava.compiler=none-xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=y

2, run–> Debug configurations, set as follows:

650) this.width=650; "title=" image "style=" border-top:0px; border-right:0px; border-bottom:0px; border-left:0px; Display:inline "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M02/54/6B/ Wkiol1sbxqzw-qqxaag-sbttv9o471.jpg "" 617 "height=" 295 "/>

Add the following variables to the Environment tab on the right side (same as before, address is port number)

Maven_opts =-xdebug-xnoagent-djava.compiler=none-xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=y

3, re-open the first step of the Setup Panel, click Run, open the second set of panels, click Debug, you can start the debugging trip, using this method of debugging, relatively local debugging, should not be so perfect, I know that the display function can not be used.

In addition, in MAVEN development will often encounter, a project consists of several projects in the workspace, in the debugging process, debugging the code of each module, is also a common need, the specific settings are as follows:

1. When running the MAVEN project, select Resolve workspace Artifacts

650) this.width=650; "title=" image "style=" border-top:0px; border-right:0px; border-bottom:0px; border-left:0px; Display:inline "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M02/54/6D/wKiom1SBxh7j5_ 1kaaduhjszjvy066.jpg "" 421 "height=" 207 "/>

2. On the Refresh tab, select resources upon completion

650) this.width=650; "title=" image "style=" border-top:0px; border-right:0px; border-bottom:0px; border-left:0px; Display:inline "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M00/54/6D/ Wkiom1sbxh-zawntaactxe-ms24158.jpg "" 443 "height=" 234 "/>

3. Add the Source tab into the workspace Workspace

650) this.width=650; "title=" image "style=" border-top:0px; border-right:0px; border-bottom:0px; border-left:0px; Display:inline "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M02/54/6B/ Wkiol1sbxq-gbsvgaaclbbswuho872.jpg "" 479 "height=" 257 "/>

This setting allows you to switch smoothly to the code of each module when you are debugging. Also, if you need to see the source of the third-party jar package that Maven relies on when debugging, you can right-click on the jar package to download the source code directly.

If you encounter a problem with jvm_bind (8080), you can use the following two commands to resolve:

Netstat-aon|findstr "8080"

Know the PID of the corresponding process, and then enter

Tasklist|fidstr "pid"

You can turn off the PID process in Resource Manager.

Maven Eclipse Debugging those Things

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.