maven学习:jetty插件与Tomcat插件
1、jetty插件
要测试的web的pom里面,加入jetty的插件配置,示例如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
<!-- 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插件
1
2
3
4
5
6
7
8
9
|
<!-- 配置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...
本文转自我爱大金子博客51CTO博客,原文链接http://blog.51cto.com/1754966750/1912065如需转载请自行联系原作者
我爱大金子