How to set jacoco coverage percentage to 60% at child's pom?
The key is we cannot override just properties of Jacoco. I have copied the below parent's pom plug in to my project and I have updated the minimum covered ratio to 60% where it was 80% in parent's pom. This is working for me.
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.2</version>
<executions>
<execution>
<id>default-check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<limits>
<limit>
<counter>INSTRUCTION</counter>
<minimum>60.0%</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
<execution>
<id>default-audit-check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<haltOnFailure>false</haltOnFailure>
<rules>
<rule>
<limits>
<limit>
<counter>INSTRUCTION</counter>
<minimum>60.0%</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<propertyName>jacoco.surefire.argLine</propertyName>
</configuration>
</execution>
</executions>
</plugin>