aboutsummaryrefslogtreecommitdiffstats
path: root/pom.xml
diff options
context:
space:
mode:
Diffstat (limited to 'pom.xml')
-rw-r--r--pom.xml50
1 files changed, 47 insertions, 3 deletions
diff --git a/pom.xml b/pom.xml
index 9d5511e..e5f9527 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,8 @@
============LICENSE_END=========================================================
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -42,6 +43,10 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<sitePath>/content/sites/site/org/onap/aai/${project.artifactId}/${project.version}</sitePath>
+ <!-- Minimum code coverage percentage. Please update this figure as coverage increases to prevent any drops in
+ coverage caused by new changes. Note that this figure cannot be lower than the ONAP requirement of 0.55 -->
+ <jacoco.line.coverage.limit>0.90</jacoco.line.coverage.limit>
+ <jacoco.report.directory>${project.build.directory}/coverage-reports</jacoco.report.directory>
</properties>
<modules>
@@ -131,20 +136,59 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
+ <version>0.7.9</version>
<configuration>
<dumpOnExit>true</dumpOnExit>
</configuration>
<executions>
<execution>
- <id>jacoco-initialize-unit-tests</id>
+ <id>pre-unit-test</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
- <destFile>${project.build.directory}/coverage-reports/jacoco.exec</destFile>
+ <destFile>${jacoco.report.directory}/jacoco.exec</destFile>
+ <propertyName>surefireArgLine</propertyName>
<!-- <append>true</append> -->
</configuration>
</execution>
+ <execution>
+ <id>post-unit-test</id>
+ <phase>test</phase>
+ <goals>
+ <goal>report</goal>
+ </goals>
+ <configuration>
+ <!-- Sets the path to the file which contains the execution data. -->
+ <dataFile>${jacoco.report.directory}/jacoco.exec</dataFile>
+ <!-- Sets the output directory for the code coverage report. -->
+ <outputDirectory>${jacoco.report.directory}/jacoco</outputDirectory>
+ </configuration>
+ </execution>
+ <execution>
+ <id>default-check</id>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <configuration>
+ <dataFile>${jacoco.report.directory}/jacoco.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>
</plugins>