zoukankan      html  css  js  c++  java
  • 【转】maven同时使用maven-surefire-report-plugin和maven-surefire-plugin默认将执行两次test

    https://issues.apache.org/jira/browse/SUREFIRE-753

    Here the pom.xml snippet how i configured the report-plugin:

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <version>2.9</version>
            <configuration>
              <outputName>failsafe-report</outputName>
              <reportsDirectories>
                <reportsDirectory>${project.build.directory}/failsafe-reports</reportsDirectory>
              </reportsDirectories>
            </configuration>
            <reportSets>
              <reportSet>
                <reports>
                  <report>report-only</report>
                </reports>
              </reportSet>
            </reportSets>
          </plugin>
    

    This means the name of the link in the navigation must be changed as well. May be it's needed to have a supplemental configuration parameter for this or the outputName could be used instead.

    maven-surefire-plugin是maven默认的test执行器。而maven-surefire-report-plugin是site生成test报表的一个插件。maven-surefire-report-plugin默认目标是report,这个将告诉maven执行test,然后搜集surefire-reports下xml生成报告。 而默认mvn site也会执行一次test。所以造成执行两次,解决办法:

    < plugin >
      < groupId >org.apache.maven.plugins< /groupId >
      < artifactId >maven-surefire-report-plugin< /artifactId >
      < version >2.7< /version >
      < reportSets >
        < reportSet >
        < reports >
          < report >report-only< /report >
        < /reports >
        < /reportSet >
      < /reportSets >
    < /plugin >

    将其目标更改report-only,则告诉报表插件,自己不用执行test了,直接使用生命周期里test的执行 surefire-reports结果。bug新颁布已经解决了。

  • 相关阅读:
    js中的鼠标滚轮事件
    js图形打印
    抽奖
    GJM : Unity3D HIAR -【 快速入门 】 五、导出 Android 工程、应用
    GJM : Unity3D HIAR -【 快速入门 】 四、创建 Hello World
    GJM : Unity3D HIAR -【 快速入门 】 三、导入 SDK
    GJM : Unity3D HIAR -【 快速入门 】 二、搭建开发环境
    GJM : Unity3D HIAR -【 快速入门 】 一、简介
    GJM :Unity集成Leap Motion
    GJM : Unity3D 高通Vuforia SDK AR 开发
  • 原文地址:https://www.cnblogs.com/shengs/p/5935341.html
Copyright © 2011-2022 走看看