关于maven集成tomcat和jacoco进行手工测试覆盖率,但是没有成功
我现在想用tomcat7-maven-plugin和jacoco-maven-plugin集成,进行手工测试的覆盖率监控。但是现在发现使用mvn tomcat7:shutdown不能关闭tomcat服务,即不能触发post-integration-test。
所以jacoco.exec就没有更新。所以想看看各位谁知道问题出在哪里?POM文件 <!--tomcat插件 -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<url>http://localhost:8080/manager/html</url>
<server>tomcat</server>
<contextReloadable>true</contextReloadable>
<systemProperties>
<JAVA_OPTS>${jacoco.agent.itArgLine}</JAVA_OPTS>
</systemProperties>
<stopKey>tomcat-shutdown</stopKey>
<stopPort>9090</stopPort>
<stopWait>10</stopWait>
</configuration>
<executions>
<execution>
<id>tomcat-startup</id>
<goals>
<goal>run-war-only</goal>
</goals>
<phase>pre-integration-test</phase>
<configuration>
<fork>true</fork>
<systemProperties>
<JAVA_OPTS>-javaagent:C:/Users/Administrator/.m2/repository/org/jacoco/org.jacoco.agent/0.7.0.201403182114/org.jacoco.agent-0.7.0.201403182114-runtime.jar=destfile=D:/02WORKSPACE/ywry/04web/target/jacoco/jacoco.exec</JAVA_OPTS>
</systemProperties>
</configuration>
</execution>
<execution>
<id>tomcat-shutdown</id>
<goals>
<goal>shutdown</goal>
</goals>
<phase>post-integration-test</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>selenium-maven-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<id>start</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start-server</goal>
</goals>
<configuration>
<background>true</background>
<logOutput>true</logOutput>
<multiWindow>true</multiWindow>
</configuration>
</execution>
<execution>
<id>stop</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop-server</goal>
</goals>
</execution>
</executions>
</plugin>
换个工具 maven自己不可能关闭Tomcat,去服务器里用命令吧 关闭Tomcat要自己写脚本吧
页:
[1]