Exclude com.ibm Packages in JaCoCo | Generated by AI

Home 2025.10

To exclude com.ibm packages (or any other packages) from JaCoCo coverage in a WebSphere Liberty Profile environment, you can configure the exclusions in your pom.xml file. This is typically done in the JaCoCo Maven plugin configuration.


How to Exclude com.ibm Packages in pom.xml

You can use the <excludes> tag in the JaCoCo plugin configuration to specify which classes or packages should be excluded from coverage reporting.

Example Configuration:

<build>
    <plugins>
        <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.11</version> <!-- Use the latest version -->
            <executions>
                <execution>
                    <goals>
                        <goal>prepare-agent</goal>
                    </goals>
                </execution>
                <execution>
                    <id>report</id>
                    <phase>test</phase>
                    <goals>
                        <goal>report</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${project.reporting.outputDirectory}/jacoco</outputDirectory>
                        <excludes>
                            <!-- Exclude all com.ibm packages -->
                            <exclude>com/ibm/**</exclude>
                        </excludes>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

Explanation:


Additional Notes:


Best Practice:


Back

mistralai/mistral-medium-3.1

Donate