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...
![S_%PQVRLATLV]D]RGAM625Q.png wKiom1jdBLaQ6GhUAAEtPk4Yx8U257.png](https://ucc.alicdn.com/awitaclaxchh6/developer-article557648/20241019/4d607c2db5684084a0e1cfe87c43b720.png?x-oss-process=image/resize,w_1400/format,webp)
效果:
![]P%KKF7HT`P)Y@}XV@6(]WR.png wKioL1jdBTry8of2AAAoX0vwGE0416.png](https://ucc.alicdn.com/awitaclaxchh6/developer-article557648/20241019/5275dc8a323f49929774e33e974a9fab.png?x-oss-process=image/resize,w_1400/format,webp)
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如需转载请自行联系原作者
我爱大金子