Few Sonar Fixes
[cps.git] / cps-parent / pom.xml
index 5aa65a2..9c1760c 100644 (file)
         <app>org.onap.cps.Application</app>
         <base.image>openjdk:11-jre-slim</base.image>
         <java.version>11</java.version>
-        <jacoco-maven-plugin.version>0.8.6</jacoco-maven-plugin.version>
         <jib-maven-plugin.version>2.6.0</jib-maven-plugin.version>
-        <minimum-coverage>0.15</minimum-coverage>
+        <minimum-coverage>0.35</minimum-coverage>
         <nexusproxy>https://nexus.onap.org</nexusproxy>
-        <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
         <oparent.version>3.1.0</oparent.version>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <releaseNexusPath>/content/repositories/releases/</releaseNexusPath>
         <repository.name>nexus3.onap.org:10001/onap/cps-service</repository.name>
         <spring-boot-maven-plugin.version>2.3.3.RELEASE</spring-boot-maven-plugin.version>
         <swagger-codegen-maven-plugin.version>3.0.18</swagger-codegen-maven-plugin.version>
         <snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath>
-        <stagingNexusPath>/content/repositories/staging/</stagingNexusPath>
         <tag.version>${project.version}</tag.version>
     </properties>
 
                 </pluginManagement>
             </build>
         </profile>
+        <profile>
+            <id>skip-db-tests</id>
+            <activation>
+                <!-- exclude module tests by default till Jenkins is configured to support test containers -->
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-surefire-plugin</artifactId>
+                        <configuration>
+                            <excludes>
+                                <exclude>**/spi/impl/*Test.java</exclude>
+                            </excludes>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
     </profiles>
 
     <dependencyManagement>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
-                <version>3.0.0-M5</version>
                 <configuration>
-                    <argLine>@{argLine}</argLine>
+                    <!--suppress UnresolvedMavenProperty -->
+                    <argLine>${surefireArgLine}</argLine>
                     <useFile>false</useFile>
                     <includes>
                         <include>**/*Spec.java</include>
                         <include>**/*Test.java</include> <!-- Just in case of having also "normal" JUnit tests -->
                     </includes>
+                    <excludes>
+                        <exclude>**/IT*.java</exclude>
+                    </excludes>
                 </configuration>
             </plugin>
             <plugin>
                 <groupId>org.jacoco</groupId>
                 <artifactId>jacoco-maven-plugin</artifactId>
-                <version>${jacoco-maven-plugin.version}</version>
                 <executions>
                     <execution>
                         <id>default-prepare-agent</id>
                             <goal>check</goal>
                         </goals>
                         <configuration>
+                            <excludes>
+                                <exclude>org/onap/cps/rest/model/*</exclude>
+                            </excludes>
+                            <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
                             <rules>
                                 <rule>
                                     <element>BUNDLE</element>