在网上看资料,有些版本不支持 reload属性,悲剧,我用的6.1.9就是那个不支持的。换成6.1.26 就好了。正确配置如下:(详情请参考网址:点击打开链接)
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.26</version>
<configuration>
<!-- 每3秒的间隔扫描一次,实现热部署 -->
<scanIntervalSeconds>3</scanIntervalSeconds>
<reload>manual</reload>
<contextPath>/</contextPath>
<stopKey>foo</stopKey>
<stopPort>9999</stopPort>
</configuration>
<executions>
<execution>
<id>start-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
<daemon>true</daemon>
</configuration>
</execution>
<execution>
<id>stop-jetty</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>