我是第一次尝试jacoco进行报道:但是jacoco的报告也包括它的apache依赖。
这是我的pom。
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.8</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<dataFile>${project.build.directory}/jacoco.exec</dataFile>
<excludes>
<exclude>*org/apache/*</exclude>
</excludes>
<outputDirectory>${project.reporting.outputDirectory}/jacoco</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
我尝试过
<exclude>**/lib/*</exclude>
也。没有什么可以从报告中删除该Apache覆盖范围。
下面是项目结构。
对于下面的我的代码,排除了工作的可能性
<exclude>**/axis-1.4.jar/**</exclude>