Jacoc覆盖率检查由于排除而失败,显示为0%覆盖率

时间:2020-10-17 08:53:21

标签: jacoco-maven-plugin

我在jacoco插件中使用了以下配置。

cgroups

但是问题是,添加排除项时,覆盖范围百分比进一步降低(变得更糟),因为排除的软件包变为0%。

我尝试在 <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <configuration> <dataFile>${user.dir}/target/jacoco.exec</dataFile> <excludes> <exclude>**/*myclass</exclude> </excludes> </configuration> <executions> <execution> <id>agent-for-ut</id> <goals> <goal>prepare-agent</goal> </goals> <configuration> <append>true</append> <destFile>${user.dir}/target/jacoco.exec</destFile> </configuration> </execution> <execution> <id>jacoco-site</id> <phase>test</phase> <goals> <goal>report</goal> </goals> <configuration> <outputDirectory>${user.dir}/target/coverage-reports/jacoco</outputDirectory> </configuration> </execution> <execution> <id>jacoco-check</id> <phase>test</phase> <goals> <goal>check</goal> </goals> <configuration> <rules> <rule> <limits> <limit> <counter>LINE</counter> <value>COVEREDRATIO</value> <minimum>80%</minimum> </limit> </limits> </rule> </rules> </configuration> </execution> </executions> </plugin> 执行下添加排除项,结果仍然相同。

有解决方案吗?

0 个答案:

没有答案