(turn) Use the Eclipse External tool to perform MVN Jetty:run

Source: Internet
Author: User

First, if the project is a standard maven-webapp then basically without modification, directly run Jetty:run can be executed.

But sometimes it's an error.

[ERROR] No plugin found for prefix ' jetty ' in the current project and the PLU
Gin groups [Org.apache.maven.plugins, Org.codehaus.mojo] available from the repo
sitories [Local (C:\Documents and Settings\reymont.li\.m2\repository), Central (
HTTP://REPO.MAVEN.APACHE.ORG/MAVEN2)] [Help 1]

Add under the Project.build node of the Pom.xml

<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.10</version>

</plugin>
</plugins>

In order to run Jetty on a WebApp project which are structured according to the usual Maven defaults (resources ${basedir}/src/main/webapp in, C Lasses ${project.build.outputDirectory web.xml ${basedir}/src/main/webapp/WEB-INF/web.xml in} and the descriptor at, you don't need to configure anything.

Simply Type:

MVN jetty:run

This would start Jetty running on port and 8080 serving your project. Jetty'll continue to run until the plugin are explicitly stopped, for example, by a <cntrl-c> .

Second, has been using jetty plug-in, after changing Ubuntu, in Eclipse installed jetty plug-in total failure, I want to abandon the use of plug-ins.

Anyway maven has been configured jetty, with MVN Jetty:run can also start jetty service, but this can not use Eclipse breakpoint debugging, compare inconvenient. The Internet survey found that you can invoke the MAVEN command with the Eclipse external tool to execute the MVN jetty:run and use debug mode. So write this article to make memo.

1. Run-External tools, External tools configurations

Configuration See

The work path is under front, but when the project requires MAVEN to execute it in the project root directory, you can use the configuration



Cut to the Environment tab and add the following variable

Name:maven_opts

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


and then save.


2 Run, Debug configurations

Note that the port numbers here are consistent with the above.


Save, Success!

(turn) Use the Eclipse External tool to perform MVN Jetty:run

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.