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:
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