Configure Jacoco plugin to enforce min coverage
[aai/spike.git] / pom.xml
diff --git a/pom.xml b/pom.xml
index c50da0a..38b34ea 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!--
-    ============LICENSE_START=======================================================
+    ============LICENSE_START=======================================================
     org.onap.aai
     ================================================================================
     Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
 
     <properties>
         <docker.location>${basedir}/target</docker.location>
-        <aaiCommonVersion>1.2.4</aaiCommonVersion>
+        <event.client.version>1.4.0-SNAPSHOT</event.client.version>
+        <version.aai-schema>1.0.0</version.aai-schema>
+        <version.aai-schema-ingest>1.4.1</version.aai-schema-ingest>
+        <!-- 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.55</jacoco.line.coverage.limit>
+        <jacoco.report.directory>${project.build.directory}/code-coverage</jacoco.report.directory>
     </properties>
 
     <dependencyManagement>
@@ -45,7 +51,7 @@
                 <!-- Import dependency management from Spring Boot -->
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-dependencies</artifactId>
-                <version>2.1.0.RELEASE</version>
+                <version>1.5.17.RELEASE</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
             <artifactId>spring-webmvc</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <!-- MODEL -->
+        <dependency>
+            <groupId>org.onap.aai.schema-service</groupId>
+            <artifactId>aai-schema</artifactId>
+            <version>${version.aai-schema}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.aai.aai-common</groupId>
+            <artifactId>aai-schema-ingest</artifactId>
+            <version>${version.aai-schema-ingest}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.powermock</groupId>
+                    <artifactId>*</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <!-- EVENT CLIENT -->
+        <dependency>
+            <groupId>org.onap.aai.event-client</groupId>
+            <artifactId>event-client-api</artifactId>
+            <version>${event.client.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.aai.event-client</groupId>
+            <artifactId>event-client-dmaap</artifactId>
+            <version>${event.client.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>com.sun.jersey</groupId>
+                    <artifactId>jersey-client</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.aai.event-client</groupId>
+            <artifactId>event-client-kafka</artifactId>
+            <version>${event.client.version}</version>
+        </dependency>
+        <dependency>
+           <groupId>org.onap.aai.event-client</groupId>
+           <artifactId>event-client-rabbitmq</artifactId>
+           <version>${event.client.version}</version>
+        </dependency>
+
         <dependency>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>
+            <version>3.7</version>
         </dependency>
 
         <dependency>
             <version>2.4</version>
         </dependency>
 
-        <dependency>
-            <groupId>org.onap.aai.aai-common</groupId>
-            <artifactId>aai-schema-ingest</artifactId>
-            <version>${aaiCommonVersion}</version>
-        </dependency>
-
         <!-- Common logging framework -->
         <dependency>
             <groupId>org.onap.aai.logging-service</groupId>
             <artifactId>logback-core</artifactId>
         </dependency>
 
-        <dependency>
-            <groupId>org.onap.aai.aai-common</groupId>
-            <artifactId>aai-core</artifactId>
-            <version>${aaiCommonVersion}</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>*</groupId>
-                    <artifactId>*</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-
         <dependency>
             <groupId>com.google.guava</groupId>
             <artifactId>guava</artifactId>
-
         </dependency>
 
         <dependency>
             <artifactId>gson</artifactId>
         </dependency>
 
-        <dependency>
-            <groupId>org.onap.aai.aai-common</groupId>
-            <artifactId>aai-schema</artifactId>
-            <version>${aaiCommonVersion}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.onap.aai.event-client</groupId>
-            <artifactId>event-client-api</artifactId>
-            <version>1.3.0</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.onap.aai.event-client</groupId>
-            <artifactId>event-client-dmaap</artifactId>
-            <version>1.3.0</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.onap.aai.event-client</groupId>
-            <artifactId>event-client-kafka</artifactId>
-            <version>1.3.0</version>
-        </dependency>
-
         <dependency>
             <groupId>org.apache.httpcomponents</groupId>
             <artifactId>httpclient</artifactId>
             <artifactId>jsonassert</artifactId>
             <scope>test</scope>
         </dependency>
+
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
+            <version>2.15.0</version>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
 
             <plugin>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
-                <version>2.0.3.RELEASE</version>
+                <version>1.5.17.RELEASE</version>
                 <executions>
                     <execution>
                         <goals>
                 <artifactId>jacoco-maven-plugin</artifactId>
                 <executions>
                     <execution>
-                        <id>prepare-agent</id>
-                        <goals>
-                            <goal>prepare-agent</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>report</id>
-                        <phase>package</phase>
+                        <id>default-check</id>
                         <goals>
-                            <goal>report</goal>
+                            <goal>check</goal>
                         </goals>
+                        <configuration>
+                            <dataFile>${jacoco.report.directory}/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>
                         <configuration>
                             <artifactItems>
                                 <artifactItem>
-                                    <groupId>org.onap.aai.aai-common</groupId>
+                                    <groupId>org.onap.aai.schema-service</groupId>
                                     <artifactId>aai-schema</artifactId>
-                                    <version>${aaiCommonVersion}</version>
-                                    <type>jar</type>
-                                    <includes>oxm/</includes>
-                                    <outputDirectory>${project.build.directory}/bundleconfig-local/etc</outputDirectory>
-                                </artifactItem>
-                                <artifactItem>
-                                    <groupId>org.onap.aai.aai-common</groupId>
-                                    <artifactId>aai-core</artifactId>
-                                    <version>${aaiCommonVersion}</version>
+                                    <version>${version.aai-schema}</version>
                                     <type>jar</type>
-                                    <includes>dbedgerules/</includes>
-                                    <excludes>**/*.ftlh</excludes>
+                                    <includes>onap/**/</includes>
                                     <outputDirectory>${project.build.directory}/bundleconfig-local/etc</outputDirectory>
                                 </artifactItem>
                             </artifactItems>