I'm trying to configure jacoco for thresholds and exclude some files from the coverage in our multi maven project. I use 0.7.9 version.
In my parent pom I use:
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>jacoco-initialize</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>jacoco-check</id>
<phase>test</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>${jacoco.percentage.instruction}</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
in one of the child maven modules there is a test that fails, I get this error only because I added jacoco in the parent.
java.lang.RuntimeException: Got: java.lang.IllegalAccessException: Class com.sun.tools.jdi.EventRequestManagerImpl can not access a member of class com.sun.tools.jdi.JDWP$EventKind with modifiers "private static transient"
However in the test itself I don't do anything that access static transient fields..It seems to come from a much lower level which I don't control.
I don't mind to skip this test from the coverage at all but I tried to add
<configuration>
<excludes>
<exclude>*NameOfTest*</exclude>
</excludes>
</configuration>
in any phase (I tried everything :( ) but it still fails for the same error.
I'm really stuck on this thing, I read a lot of documentation but nothing helped me here.
Please I hope you could help me with this.
Thanks a lot
Regards
Vered
Thank you for your quick response.
I added this configuration and it finally helped!! :-)
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>com.sun.*</exclude>
</excludes>
</configuration>
</plugin>
Thank you so much!!
Regards,
Vered