具体做法如下:
1 在pom.xml文件中配置maven-jetty-plugin插件。
<plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <configuration> <scanIntervalSeconds>10</scanIntervalSeconds> <webApp> <contextPath>/test</contextPath> </webApp> <connectors> <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector"> <port>8080</port> <maxIdleTime>60000</maxIdleTime> </connector> </connectors> </configuration> </plugin>
2.启动jetty服务器
jetty:run
相关推荐
maven集成jetty必须jar包maven-jetty-plugin,内含多个版本
maven-jetty-plugin-6.1.3.jar
maven-jetty-plugin-6.1.7.jar
maven-jetty-plugin-6.1.5.jar
maven-jetty-jspc-plugin-6.1.9.jar
maven-jetty6-plugin-1.0.jar
maven-jetty-plugin-6.1.26.jar
maven-jetty-jspc-plugin-6.1.22-site-component.jar
maven-jetty-jspc-plugin-6.1.25-sources.jar
maven-jetty-plugin-6.1.25-sources.jar
maven-jetty-plugin-6.1h.14.1-sources.jar
maven-jetty-plugin-6.1.26-sources.jar
maven-jetty-plugin-6.1.8.jar
maven-jetty-plugin-6.1.22-site-component.jar
maven-jetty-plugin-6.1.9.jar
maven-jetty-plugin-6.1.6.jar
maven-jetty-plugin-6.1.4.jar
maven-jetty-plugin-6.1.9-sources.jar
maven-jetty-plugin-6.1.8-sources.jar