<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.4.4.v20170414</version>
<configuration>
<httpConnector>
<port>8081</port>
<host>localhost</host>
<idleTimeout>60</idleTimeout>
</httpConnector>
<stopKey>access-jetty</stopKey>
<stopPort>9011</stopPort>
<stopWait>10</stopWait>
<scanIntervalSeconds>1</scanIntervalSeconds>
<webAppSourceDirectory>src/main/webapp</webAppSourceDirectory>
<webApp>
<contextPath>/</contextPath>
</webApp>
<tempDirectory>${project.build.directory}/work</tempDirectory>
</configuration>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.4.4.v20170414</version>
<configuration>
<httpConnector>
<port>8081</port>
<host>localhost</host>
<idleTimeout>60</idleTimeout>
</httpConnector>
<stopKey>access-jetty</stopKey>
<stopPort>9011</stopPort>
<stopWait>10</stopWait>
<scanIntervalSeconds>1</scanIntervalSeconds>
<webAppSourceDirectory>src/main/webapp</webAppSourceDirectory>
<webApp>
<contextPath>/</contextPath>
</webApp>
<tempDirectory>${project.build.directory}/work</tempDirectory>
</configuration>
</plugin>
启动 jetty:run
停止 jetty:stop
参考:http://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html#get-up-and-running