How to exclude packages from the SonarQube coverage globally filled with a jacoco report?

advertisements

I´m using jacoco with SonarQube for coverage overall, and I´m trying to exclude some package from coverage overall, but seems does not works. I just follow the same conf that people publish in diferents blogs, but like I said could not make it works. Here my configuration. Do you see something wrong there?

<plugin>
    <groupId>org.jacoco</groupId>
    <artifactId>jacoco-maven-plugin</artifactId>
    <version>${jacoco-maven-plugin.version}</version>
    <configuration>
        <skip>${jacoco.skip}</skip>
        <destFile>${jacoco.datafile}</destFile>
        <append>true</append>
        <excludes>
            <exclude>**/src/main/java/com/utils/**</exclude>
            <exclude>**/TibcoBrokerWrapper.java</exclude>
            <exclude>**/src/main/java/com/cosdemo/**/*</exclude>
            <exclude>**/src/main/java/com/mock/**/*</exclude>
            <exclude>**/src/main/java/com/behaviour/**/*</exclude>
            <exclude>**/src/main/java/com/behaviour/**</exclude>
            <exclude>com.utils</exclude>
        </excludes>
    </configuration>
</plugin>


You need to set this from the UI, not in your pom. See the docs for more.