我的代码包含测试,这些测试在mvn clean install
我已经包含了一个cobertura prlugin以生成报告
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<formats>
<format>xml</format>
<format>html</format>
</formats>
<check/>
</configuration>
<executions>
<execution>
<phase>clean</phase>
<goals>
<goal>cobertura</goal>
</goals>
</execution>
</executions>
</plugin>
最后,HTML按预期在target
中生成。 index.html
显示所有类和包但是......没有覆盖率信息(所有人的覆盖率为0%)
如果我通过IntelliJ
导出保险,则会适当地显示保险范围。我的设置缺少明显的东西吗?
请帮助我理解。
答案 0 :(得分:1)
看起来问题是您尝试在项目的cobertura
阶段执行clean
。
根据文档,Cobertura使用自己的生命周期:http://mojo.codehaus.org/cobertura-maven-plugin/cobertura-mojo.html
请从<phase>clean</phase>
配置中删除execution
,然后重试。
此处进一步参考: