锘??xml version="1.0" encoding="utf-8" standalone="yes"?> 涓嬮潰鎴戜滑鐢╩aven鍋氬埌鑷姩鍖栵紒 鎴戜滑鍒╃敤maven鐨勭敓鍛藉懆鏈熷拰jetty鎻掍歡鏉ュ疄鐜般?span style="color: #008000; "> 涓嬮潰鎻忚堪涓嬪仛鐨勮嚜鍔ㄥ寲web闆嗘垚嫻嬭瘯瀹炵幇鐨勫師鐞嗐?/p> 1錛屽湪鐢熷懡鍛ㄦ湡pre-integration-test鍚姩jetty瀹瑰櫒 2錛屽湪鐢熷懡鍛ㄦ湡integration-test涓祴璇曟垜浠啓鐨?**IT.java綾?/p> 3錛屽湪post-integration-test shutdow jetty瀹瑰櫒銆?/p> 鍦╬om.xml涓姞鍏ヤ唬鐮佸涓嬶細(xì) 鐒跺悗灝卞彲浠ョ紪鍐欐祴璇曠敤渚嬩簡 姝ラ濡備笅錛?/p> 1錛屽畾涔変竴涓互姝ゅ懡鍚嶇殑****IT鐨勬祴璇曠被錛坕ntegration test緙╁啓錛夛紝 鍦ㄩ噷闈㈠崕涓界殑鍐欏ソ浣犵殑嫻嬭瘯閫昏緫銆?/p> 鍐嶆涓嶄婦渚嬩簡錛屼富瑕佷竴涓濊礬鍙互鐢╤ttpclint鏉ュ疄鐜伴噷闈㈢殑嫻嬭瘯浠g爜銆?br /> 2錛岀劧鍚?鎵ц mvn clean post-integration-test -Pittest 濂戒簡 灝卞彲浠ョ湅鍒版垜浠祴璇曠敤渚嬫槸鍚﹂氳繃銆?/p>
<profile>
<id>ittest</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>run-integration-test</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<includes>
<include>**/*IT.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.26</version>
<configuration>
<contextPath>/</contextPath>
<stopPort>9966</stopPort>
<stopKey>stop-jetty-for-it</stopKey>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>6211</port>
</connector>
</connectors>
</configuration>
<executions>
<execution>
<id>start-it-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<daemon>true</daemon>
</configuration>
</execution>
<execution>
<id>stop-it-jetty</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>