【问题标题】:jacoco including apache in reportjacoco 在报告中包括 apache
【发布时间】: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


【解决方案1】:

对于我下面的代码排除工作

<exclude>**/axis-1.4.jar/**</exclude> 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-05-27
    • 2013-06-27
    • 1970-01-01
    • 1970-01-01
    • 2017-03-04
    • 2019-02-17
    • 2018-09-22
    • 2020-02-16
    相关资源
    最近更新 更多