Fix Sonar Java Coverage
[clamp.git] / pom.xml
diff --git a/pom.xml b/pom.xml
index 227b48f..8d6e72c 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@
        <parent>
                <groupId>org.onap.oparent</groupId>
                <artifactId>oparent</artifactId>
-               <version>2.0.0</version>
+               <version>2.1.0</version>
        </parent>
 
        <description>
                <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
                <clamp.project.version>${project.version}</clamp.project.version>
                <clamp.build.timestamp>${maven.build.timestamp}</clamp.build.timestamp>
-               <maven.compiler.source>1.8</maven.compiler.source>
-               <maven.compiler.target>1.8</maven.compiler.target>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
 
                <eelf.core.version>1.0.0</eelf.core.version>
                <camel.version>2.24.0</camel.version>
-               <springboot.version>2.1.5.RELEASE</springboot.version>
+               <springboot.version>2.2.0.RELEASE</springboot.version>
 
                <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
                <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath>
-               <sonar.jacoco.reportPath>${project.build.directory}/coverage-reports/jacoco.exec</sonar.jacoco.reportPath>
-               <sonar.jacoco.itReportPath>${project.build.directory}/coverage-reports/jacoco-it.exec</sonar.jacoco.itReportPath>
+               <!-- The value below comes from the jacoco maven plugin output, sonar now takes xml only -->
+               <sonar.coverage.jacoco.xmlReportPaths>${project.build.directory}/jacoco-html-xml-reports/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
+               <!-- <sonar.jacoco.reportPath>${project.build.directory}/coverage-reports/jacoco.exec</sonar.jacoco.reportPath>
+               <sonar.jacoco.itReportPath>${project.build.directory}/coverage-reports/jacoco-it.exec</sonar.jacoco.itReportPath> -->
                <sonar.jacoco.reportMissing.force.zero>true</sonar.jacoco.reportMissing.force.zero>
                <sonar.projectVersion>${project.version}</sonar.projectVersion>
                <!-- Enable language to disable javascript analysis -->
                <docker.skip.tag>true</docker.skip.tag>
                <skip.staging.artifacts>false</skip.staging.artifacts>
                <python.http.proxy.param />
-               <tomcat.version>9.0.20</tomcat.version>
+               <tomcat.version>9.0.27</tomcat.version>
                <ui.react.src>ui-react</ui.react.src>
                <npm.publish.url>https://nexus3.onap.org/repository/npm.release/</npm.publish.url>
        </properties>
                        <groupId>org.apache.xmlgraphics</groupId>
                        <artifactId>batik-svggen</artifactId>
                        <version>1.11</version>
+                       <exclusions>
+                       <exclusion>
+                               <groupId>xml-apis</groupId>
+                               <artifactId>xml-apis</artifactId>
+                       </exclusion>
+                       </exclusions>
                </dependency>
                <dependency>
                        <groupId>org.apache.xmlgraphics</groupId>
                        <groupId>com.att.eelf</groupId>
                        <artifactId>eelf-core</artifactId>
                        <version>${eelf.core.version}</version>
+                       <exclusions>
+                               <exclusion>
+                                       <groupId>org.powermock</groupId>
+                                       <artifactId>powermock-module-junit4</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>org.powermock</groupId>
+                                       <artifactId>powermock-api-mockito</artifactId>
+                               </exclusion>
+                       </exclusions>
                </dependency>
                <dependency>
                        <groupId>org.codehaus.janino</groupId>
                <dependency>
                        <groupId>org.mockito</groupId>
                        <artifactId>mockito-core</artifactId>
-                       <version>1.10.19</version>
+                       <version>2.28.2</version>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.powermock</groupId>
+                       <artifactId>powermock-api-mockito2</artifactId>
+                       <version>2.0.4</version>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.powermock</groupId>
+                       <artifactId>powermock-module-junit4</artifactId>
+                       <version>2.0.4</version>
                        <scope>test</scope>
                </dependency>
        </dependencies>
 
                <plugins>
                        <plugin>
-                               <groupId>de.jpdigital</groupId>
-                               <artifactId>hibernate52-ddl-maven-plugin</artifactId>
-                               <version>2.2.0</version>
+                                       <groupId>de.jpdigital</groupId>
+                                       <artifactId>hibernate52-ddl-maven-plugin</artifactId>
+                                       <version>2.2.0</version>
                                <dependencies>
                                        <dependency>
                                                <groupId>javax.xml.bind</groupId>
                                                </goals>
                                                <configuration>
                                                        <packages>
-                                                               <param>org.onap.clamp.dao.model</param>
+                                                               <param>org.onap.clamp</param>
                                                        </packages>
                                                        <dialects>
                                                                <param>MARIADB53</param>
                                        </execution>
                                </executions>
                        </plugin>
+                       <plugin>
+                               <groupId>org.codehaus.groovy.maven</groupId>
+                               <artifactId>gmaven-plugin</artifactId>
+                               <version>1.0</version>
+                               <executions>
+                                       <execution>
+                                               <phase>validate</phase>
+                                               <goals>
+                                                       <goal>execute</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <source>${project.basedir}/src/main/script/SelectNpmRepo.groovy</source>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-jar-plugin</artifactId>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-surefire-plugin</artifactId>
-                               <version>2.22.1</version>
+                               <version>2.22.2</version>
                                <configuration>
                                        <forkCount>1C</forkCount>
                                        <reuseForks>true</reuseForks>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-failsafe-plugin</artifactId>
-                               <version>2.22.1</version>
+                               <version>2.22.2</version>
                                <executions>
                                        <execution>
                                                <id>integration-tests</id>
                        <plugin>
                                <groupId>io.fabric8</groupId>
                                <artifactId>docker-maven-plugin</artifactId>
-                               <version>0.27.2</version>
+                               <version>0.31.0</version>
                                <dependencies>
                                        <dependency>
                                                <groupId>org.apache.httpcomponents</groupId>
                                                                <ports>
                                                                        <port>${docker.mariadb.port.host}:3306</port>
                                                                </ports>
+                                                               <network>
+                                                                       <mode>bridge</mode>
+                                                               </network>
                                                        </run>
                                                </image>
                                                <image>
                                                                        <shell>./start_http_cache.sh ${python.http.proxy.param}
                                                                                --python_proxyaddress=localhost:${docker.http-cache.port.host}</shell>
                                                                </cmd>
+                                                               <network>
+                                                                       <mode>bridge</mode>
+                                                               </network>
                                                        </run>
                                                </image>
                                                <image>
                        <plugin>
                                <groupId>org.jacoco</groupId>
                                <artifactId>jacoco-maven-plugin</artifactId>
-                               <version>0.8.2</version>
+                               <version>0.8.5</version>
                                <configuration>
                                        <dumpOnExit>true</dumpOnExit>
                                        <append>true</append>
                                        <includes>
-                                               <include>org.onap.clamp.*</include>
+                                               <include>org/onap/clamp/**</include>
                                        </includes>
                                </configuration>
                                <executions>
                                                                        </includes>
                                                                </fileSet>
                                                        </fileSets>
-                                                       <destFile>${project.build.directory}/jacoco-dev.exec</destFile>
+                                                       <destFile>${project.build.directory}/jacoco.exec</destFile>
+                                               </configuration>
+                                       </execution>
+                                       <execution>
+                                               <id>report-xml</id>
+                                               <goals>
+                                                       <goal>report</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <!-- Setting explicit path, so that we remember where it picks them up from -->
+                                                       <dataFile>${project.build.directory}/jacoco.exec</dataFile>
+                                                       <outputDirectory>${project.build.directory}/jacoco-html-xml-reports</outputDirectory>
                                                </configuration>
                                        </execution>
                                </executions>
                                                </goals>
                                                <phase>deploy</phase>
                                                <configuration>
-                                                       <arguments>run-script publish</arguments>
+                                                       <arguments>publish</arguments>
                                                </configuration>
                                        </execution>
                                </executions>
                        </plugin>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-compiler-plugin</artifactId>
+                               <version>3.8.1</version>
+                               <configuration>
+                                       <source>11</source>
+                                       <target>11</target>
+                               </configuration>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.sonarsource.scanner.maven</groupId>
+                               <artifactId>sonar-maven-plugin</artifactId>
+                               <version>3.7.0.1746</version>
+                       </plugin>
                </plugins>
        </build>
 </project>