在pom.xml中配置jetty插件:
<plugins> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> <version>6.1.26</version> <configuration> <webAppSourceDirectory>src/main/webapp</webAppSourceDirectory> <scanIntervalSeconds>6</scanIntervalSeconds> <contextPath>/prospect</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> </plugins>