标签:limit 代码覆盖率 添加 命令 undle repo 覆盖率 统计代码 art
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>default-check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>COMPLEXITY</counter>
<value>COVEREDRATIO</value>
<minimum>0.10</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
1、在pom.xml文件中添加jacoco插件,如上;
2、执行maven install 命令 ,在target\site\jacoco目录下可看到代码覆盖率html文件。
标签:limit 代码覆盖率 添加 命令 undle repo 覆盖率 统计代码 art
原文地址:https://www.cnblogs.com/wangfg/p/12308237.html