Maven Surefire报告覆盖了以前的报告

时间:2017-05-10 14:39:01

标签: maven maven-surefire-plugin

每次我使用maven执行测试时,都会将结果写在之前的结果上...... 有没有办法在带有时间戳的文件夹上生成输出?或任何其他解决方案?

1 个答案:

答案 0 :(得分:0)

您可以在插件配置中个性化报告名称:

<project>
  [...]
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>2.20</version>
        <configuration>
          <outputName>desired_name</outputName>
        </configuration>
      </plugin>
    </plugins>
  </reporting>
  [...]
</project>

然后,您可以将名称与pom中的时间戳连接起来:${maven.build.timestamp}

取自here

此外,您还可以指定报告的输出文件夹。它就在plugin documentation page