51Testing软件测试论坛
标题: 关于maven集成tomcat和jacoco进行手工测试覆盖率,但是没有成功 [打印本页]
作者: 测试积点老人 时间: 2019-2-28 09:36
标题: 关于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>
复制代码
作者: qqq911 时间: 2019-3-1 10:38
换个工具
作者: abcsell 时间: 2019-3-1 10:42
maven自己不可能关闭Tomcat,去服务器里用命令吧
作者: jingzizx 时间: 2019-3-1 12:53
关闭Tomcat要自己写脚本吧
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) |
Powered by Discuz! X3.2 |