參考:http://czj4451.iteye.com/blog/1942437web
準備工做:
在pom.xml中配置jetty插件: app
<plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> <version>8.1.16.v20140903</version> <configuration> <webAppSourceDirectory>src/main/webapp</webAppSourceDirectory> <scanIntervalSeconds>6</scanIntervalSeconds> <contextPath>/</contextPath> <webDefaultXml>jetty.xml</webDefaultXml> <jettyEnvXml>jetty-env.xml</jettyEnvXml> <connectors> <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector"> <port>8080</port> <headerBufferSize>80000</headerBufferSize> </connector> </connectors> <stopKey>stop</stopKey> <stopPort>8089</stopPort> </configuration> </plugin>
Jetty實戰之 maven+嵌入式Jetty運行web app:webapp