Exclude folder in jacoco coverage report

喜欢而已 提交于 2019-11-30 11:03:54

I think that is not possible because your compiled classes are in the same directory in target. And Jacoco needs the compiled classes and therefore you can not make a filter on sources.

You can exclude classes in the Jacoco report by setting an exclude path but the values should be the path of compiled classes relative to the directory target/classes/.

<plugin>
    <groupId>org.jacoco</groupId>
    <artifactId>jacoco-maven-plugin</artifactId>
    <configuration>
        <excludes>
            <exclude>**/*.class</exclude>
        </excludes>
    </configuration>
</plugin>

The best solution would be to generate the classes in a specific package. But maybe you can't.

Simply doing the below solved my problem of ignoring a package rather than the files.

<configuration>
    <excludes>
        <exclude>**/basepkg/subpkg1/subpkg2/*</exclude>
    </excludes>
</configuration>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!