【发布时间】:2019-03-07 15:30:08
【问题描述】:
我有一个带有 jacoco 插件的 maven 项目,它可以生成不同格式的报告,例如 html、csv 和 xml。但我只需要html。如何指定?
这是一些代码,我在其中添加了 jacoco 插件:
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.plugin.version}</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
//other plugins
</plugins>
</build>
然后我运行测试:
mnv clean test
所有报告都出现在“目标”目录中。
我阅读了文档https://www.eclemma.org/jacoco/trunk/doc/maven.html,但没有找到有关如何选择所需格式的任何信息。我发现它只适用于 Ant 和 Gradle。
我想我错过了一些东西,所以我会很感激任何线索。
【问题讨论】:
标签: maven code-coverage jacoco jacoco-maven-plugin