【发布时间】:2015-09-01 05:44:03
【问题描述】:
我正在使用 JunitReport 任务使用 maven 生成 HTML 格式的 junit 报告。
我在 pom.xml 中添加了以下项目以生成 HTML 格式的测试报告
<plugin>
<!-- Extended Maven antrun plugin -->
<!-- https://maven-antrun-extended-plugin.dev.java.net/ -->
<groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
<artifactId>maven-antrun-extended-plugin</artifactId>
<executions>
<execution>
<id>test-reports</id>
<phase>test</phase>
<configuration>
<tasks>
<junitreport todir="target/surefire-reports">
<fileset dir="target/surefire-reports">
<include name="**/*.xml" />
</fileset>
<report format="noframes" todir="target/surefire-reports" />
</junitreport>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-junit</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-trax</artifactId>
<version>1.8.0</version>
</dependency>
</dependencies>
</plugin>
html 报告名称始终显示为 junit-noframes.html。由于我生成了更多的 html 报告,因此每个 html 报告都生成了与 junit-noframes.html 相同的名称。我想给自定义的 html 报告名称。
如何更改 html 报告名称?我没有找到任何选项。
【问题讨论】:
-
有什么解决办法吗?
-
对自己的问题添加评论通常不是很有帮助,除非已经有听众(以前的评论者或海报):没有人会看到它。相反,请考虑更新我们的问题,因为没有人回答的通常原因是它太复杂而无法适应问答网站,或者不清楚您在问什么。也就是说,我同时回答了你的问题;)。
标签: maven xslt ant junit maven-antrun-plugin