set the code coverage limit check
[aai/rest-client.git] / pom.xml
diff --git a/pom.xml b/pom.xml
index 251e63c..752b5c9 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -42,6 +42,7 @@
         <sonar.jacoco.reportPath>${project.build.directory}/code-coverage/jacoco-ut.exec</sonar.jacoco.reportPath>
         <sonar.jacoco.reportMissing.force.zero>false</sonar.jacoco.reportMissing.force.zero>
         <sonar.projectVersion>${project.version}</sonar.projectVersion>
+        <jacoco.line.coverage.limit>0.84</jacoco.line.coverage.limit>
     </properties>
 
     <dependencies>
                 <artifactId>jacoco-maven-plugin</artifactId>
                 <version>0.7.7.201606060606</version>
                 <configuration>
-                    <dumpOnExit>true</dumpOnExit>
+                     <dumpOnExit>true</dumpOnExit>
                 </configuration>
                 <executions>
                     <execution>
                             <!-- <append>true</append> -->
                         </configuration>
                     </execution>
+                    <execution>
+                        <id>default-check</id>
+                        <goals>
+                            <goal>check</goal>
+                        </goals>
+                        <configuration>
+                            <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
+                            <rules>
+                                <!--  implementation is needed only for Maven 2  -->
+                                <rule implementation="org.jacoco.maven.RuleConfiguration">
+                                    <element>BUNDLE</element>
+                                    <limits>
+                                        <limit implementation="org.jacoco.report.check.Limit">
+                                            <counter>LINE</counter>
+                                            <value>COVEREDRATIO</value>
+                                            <minimum>${jacoco.line.coverage.limit}</minimum>
+                                        </limit>
+                                    </limits>
+                                </rule>
+                            </rules>
+                        </configuration>
+                    </execution>
                 </executions>
             </plugin>