51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 3227|回复: 3
打印 上一主题 下一主题

[求助] 关于maven集成tomcat和jacoco进行手工测试覆盖率,但是没有成功

[复制链接]
  • TA的每日心情
    无聊
    昨天 09:21
  • 签到天数: 409 天

    连续签到: 3 天

    [LV.9]测试副司令

    跳转到指定楼层
    1#
    发表于 2019-2-28 09:36:32 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    1测试积点

    我现在想用tomcat7-maven-plugin和jacoco-maven-plugin集成,进行手工测试的覆盖率监控。
    但是现在发现使用mvn tomcat7:shutdown不能关闭tomcat服务,即不能触发post-integration-test。
    所以jacoco.exec就没有更新。所以想看看各位谁知道问题出在哪里?

    POM文件

    1. <!--tomcat插件 -->
    2.         <plugin>
    3.             <groupId>org.apache.tomcat.maven</groupId>
    4.             <artifactId>tomcat7-maven-plugin</artifactId>
    5.             <version>2.2</version>
    6.             <configuration>
    7.                 <url>http://localhost:8080/manager/html</url>  
    8.                 <server>tomcat</server>
    9.                 <contextReloadable>true</contextReloadable>
    10.                 <systemProperties>
    11.                     <JAVA_OPTS>${jacoco.agent.itArgLine}</JAVA_OPTS>
    12.                 </systemProperties>
    13.                 <stopKey>tomcat-shutdown</stopKey>
    14.                 <stopPort>9090</stopPort>
    15.                 <stopWait>10</stopWait>
    16.             </configuration>
    17.             <executions>
    18.                 <execution>
    19.                     <id>tomcat-startup</id>
    20.                     <goals>
    21.                         <goal>run-war-only</goal>
    22.                     </goals>
    23.                     <phase>pre-integration-test</phase>
    24.                     <configuration>
    25.                         <fork>true</fork>
    26.                         <systemProperties>
    27.                             <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>
    28.                         </systemProperties>
    29.                     </configuration>
    30.                 </execution>
    31.                 <execution>
    32.                     <id>tomcat-shutdown</id>
    33.                     <goals>
    34.                         <goal>shutdown</goal>
    35.                     </goals>
    36.                     <phase>post-integration-test</phase>
    37.                 </execution>
    38.             </executions>
    39.         </plugin>
    40.         <plugin>
    41.             <groupId>org.codehaus.mojo</groupId>
    42.             <artifactId>selenium-maven-plugin</artifactId>
    43.             <version>2.3</version>
    44.             <executions>
    45.                 <execution>
    46.                     <id>start</id>
    47.                     <phase>pre-integration-test</phase>
    48.                     <goals>
    49.                         <goal>start-server</goal>
    50.                     </goals>
    51.                     <configuration>
    52.                         <background>true</background>
    53.                         <logOutput>true</logOutput>
    54.                         <multiWindow>true</multiWindow>
    55.                     </configuration>
    56.                 </execution>
    57.                 <execution>
    58.                     <id>stop</id>
    59.                     <phase>post-integration-test</phase>
    60.                     <goals>
    61.                         <goal>stop-server</goal>
    62.                     </goals>
    63.                 </execution>
    64.             </executions>
    65.         </plugin>
    复制代码


    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    昨天 10:14
  • 签到天数: 1392 天

    连续签到: 3 天

    [LV.10]测试总司令

    2#
    发表于 2019-3-1 10:38:14 | 只看该作者
    换个工具
    回复

    使用道具 举报

  • TA的每日心情
    开心
    2021-12-27 08:30
  • 签到天数: 471 天

    连续签到: 1 天

    [LV.9]测试副司令

    3#
    发表于 2019-3-1 10:42:42 | 只看该作者
    maven自己不可能关闭Tomcat,去服务器里用命令吧
    回复

    使用道具 举报

  • TA的每日心情
    慵懒
    昨天 07:14
  • 签到天数: 2666 天

    连续签到: 3 天

    [LV.Master]测试大本营

    4#
    发表于 2019-3-1 12:53:43 | 只看该作者
    关闭Tomcat要自己写脚本吧
    回复

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-5-9 02:41 , Processed in 0.064769 second(s), 21 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表