Jacoco Maven Site Report und Jenkins JacocoPublisher unterscheiden sich

43 views
Skip to first unread message

Sebastian (Skillkiller)

unread,
Apr 20, 2023, 1:06:05 PM4/20/23
to Jenkins JaCoCo plugin mailing list
Hello,
I use the JacocoPublisher plugin in Jenkins to visualize test coverage. I have defined some exclusions in the pom.xml. These are also respected by the Maven site generator, but the Jenkins plugin still displays exclusions in the test coverage.

pom.xml plugin section:
<plugin>
    <groupId>org.jacoco</groupId>
    <artifactId>jacoco-maven-plugin</artifactId>
    <version>0.8.8</version>
    <configuration>
        <excludes>
            <exclude>com/sebastian/p1/**/*</exclude>
            <exclude>com/sebastian/**/*</exclude>
        </excludes>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>prepare-agent</goal>
            </goals>
        </execution>
        <execution>
            <id>report</id>
            <phase>prepare-package</phase>
            <goals>
                <goal>report</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Maven Site:
Unbenannt1.png

Jenkins plugin:
Unbenannt2.png

The values differ by several percent. Missed Instructions 9% vs 1%...

Is it possible that the Jenkins plugin can read the exclusions from the pom.xml directly. I don't want to have to maintain 2 list of exclusions.

Thank you,
Sebastian

Dominik Stadler

unread,
Apr 21, 2023, 1:11:20 AM4/21/23
to jenkins-jacoco-pl...@googlegroups.com
Hi,

Unfortunately there is currently no functionality which can re-use exclusions and other configuration from pom.xml/build.gradle so you need to keep them twice.

As there are many different ways how this could be specified in the various build-systems, it would be hard to do this in a general fashion. Maven POM would probably fairly easy as it is a more strict format, but you would still need to handle variable replacements and other XML features.

Dominik.


--
Azért kapta ezt az üzenetet, mert feliratkozott a Google Csoportok „Jenkins JaCoCo plugin mailing list” csoportjára.
Az erről a csoportról és az ahhoz kapcsolódó e-mailekről való leiratkozáshoz küldjön egy e-amailt a(z) jenkins-jacoco-plugin-m...@googlegroups.com címre.
Ha szeretné megtekinteni ezt a beszélgetést az interneten, látogasson el ide: https://groups.google.com/d/msgid/jenkins-jacoco-plugin-mailing-list/726ab1c4-2d17-49fd-8285-199d49377cb9n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages