Debug Maven projects in eclipse

Source: Internet
Author: User

One convenient way to use Maven is to use jetty plugin to run web projects. Only Maven jetty: Run can run the WEB Project. Most of the time, we need to debug it in IDE. So how can I debug a web project using jetty Plugin in eclipse?
Next we will configure it.

  1. First, choose run> externel tools> open externel tools.
    Dialog .. open the configuration dialog box, select the program node on the left, right-click New, and enter name information in the configuration on the right. In Main
    Select the full path of your Maven executable file (eg:/home/Rory/apps/apache-maven-2.0.8/bin
    /MVN), Working
    Directory select your Maven Project (eg: $ {workspace_loc:/guice-example}), enter
    Jetty: Run. Then switch to the Environment tab. New variable, name is
    MAVEN_OPTS

    Value is
    -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=y

    OK. This step is complete. Apply and close.
  2. Connect
    Next, add a debug, Open Run-> open debug dialog .. open the debug dialog window, and select the remote
    Java application, right-click New and enter name. Select the project connection to be debugged in the project.
    Set "host" in properties to localhost, "Port" to "4000" configured above, and then apply.
  3. Next we can start debugging. Start the externel tools configuration in step 1, and then run debug in step 2. You can see that the console has the output of MVN jetty: Run. Next, let's start debugging your project. :)
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.