'How to exclude certain package while running the Code Coverage in spring Boot using jacoco

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

I want to ignore all class under certain package. Im running Code coverage option given in the eclipse itself. If anything is wrong comment down



Solution 1:[1]

Here is a working example for includes and exclude configuration of jacoco-maven-plugin.

All classes which has jacocodemo in it is package are included except if they have jacocodemo/strings in them.

<execution>
    <id>jacoco-report</id>
    <goals>
        <goal>report</goal>
    </goals>
    <configuration>
        <includes>
            <include>**/jacocodemo/**/*</include>
        </includes>
        <excludes>
            <exclude>**/jacocodemo/strings/*</exclude>
        </excludes>
    </configuration>
</execution>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Code Journal