【发布时间】:2020-06-28 07:03:39
【问题描述】:
我是第一次尝试 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 覆盖范围。
下面是项目结构。
【问题讨论】:
-
您能分享一下您的项目结构吗?
-
我得到了解决方案。
**/axis-1.4.jar/** 这对我来说可以排除外部 jar 文件
标签: maven junit jacoco jacoco-maven-plugin