Using the jetty Maven plugin and the Tomcat maven plugin
1. Jetty Maven Plugin
The POM configuration is as follows
<Build> <Finalname>WebApp</Finalname> <Plugins> <plugin> <groupId>Org.eclipse.jetty</groupId> <Artifactid>Jetty-maven-plugin</Artifactid> <version>9.4.6.v20170531</version> </plugin> </Plugins></Build>
Add Jetty:rum command at run time
Run,console prompts jetty to start successfully.
At this point, access to the Site Web project is localhost:8080 through the browser
2. Tomcat Maven Plugin
The POM is configured as follows and can be found from the Tomcat official documentation.
<Build> <Finalname>WebApp</Finalname> <Plugins> <plugin> <groupId>Org.apache.tomcat.maven</groupId> <Artifactid>Tomcat7-maven-plugin</Artifactid> <version>2.2</version> </plugin> </Plugins></Build>
Run as follows, add the Tomcat:run command
Run Success prompt
3, the implementation of the project packaging directly run plug-ins can be added to the following POM configuration
<Build> <Finalname>WebApp</Finalname> <Plugins> <plugin> <groupId>Org.eclipse.jetty</groupId> <Artifactid>Jetty-maven-plugin</Artifactid> <version>9.4.6.v20170531</version> <executions> <Execution> <Phase>Package</Phase> <Goals> <goal>Run</goal> </Goals> </Execution> </executions> </plugin> </Plugins></Build>
Building a Java Web project with Eclipse + Maven (iii)