1、jetty插件
要测试的web的pom里面,加入jetty的插件配置,示例如下:
<!-- jetty插件 --> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>8.1.14.v20131031</version> <configuration> <scanIntervalSeconds>10</scanIntervalSeconds> <stopPort>9999</stopPort> <webAppConfig> <contextPath>/customer</contextPath> </webAppConfig> <connectors> <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector"> <port>9080</port> <maxIdleTime>60000</maxIdleTime> </connector> </connectors> </configuration> </plugin>
eclipse配置:右击项目-->Run As-->Run Configurations...
效果:
2、tomcat插件
<!-- 配置Tomcat插件 --> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <configuration> <port>8080</port> <path>/</path> </configuration> </plugin>
eclipse配置:右击项目-->Run As-->Run Configurations...
时间: 2024-11-09 06:10:30