Jetty Plugin: http://jettylauncher.sourceforge.net/updates/
Jetty plug-in is often used in Maven projects. MVN jetty: Run starts port 8080 by default. Tomcat usually occupies this port. You can manually modify the startup port of jetty plug-in by running the following command:
MVN jetty: Run-djetty. Port = 9999
Another method is to modify the POM file. The jetty plug-in code is as follows:
<Plugin>
<Groupid> org. mortbay. jetty </groupid>
<Artifactid> Maven-jetty-plugin </artifactid>
<Version> 6.1.6 </version>
<Configuration>
<Connectors>
<Connector implementation = "org. mortbay. Jetty. NiO. selectchannelconnector">
<Port> 9999 </port>
<Maxidletime> 60000 </maxidletime>
</Connector>
</Connectors>
</Configuration>
</Plugin>
Enter the port you want to start on the port node. Mine is 9999. Jetty plugin Official Website:
Http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin
During project packaging or deployment, you must skip the test code section. The command is as follows:
MVN-dmaven. Test. Skip = true package
Run
MVN jetty: Run-war
Result error prompt
The plugin 'org. mortbay. jetty: Maven-jetty-plugin 'does not exis
After adding such a sentence in settings. XML, solve the problem.
Reference <plugingroups>
<Plugingroup> org. mortbay. jetty </plugingroup>
</Plugingroups>
The cause of my above error is that the jetty plug-in is not configured in POM. xml of my project.
The solution can also be added to the Pom. xml file of your project.
Reference
<Project>
[...]
<Build>
<Finalname> simple-webapp </finalname>
<Plugins>
<Plugin>
<Groupid> org. mortbay. jetty </groupid>
<Artifactid> Maven-jetty-plugin </artifactid>
</Plugin>
</Plugins>
</Build>
[...]
</Project>