Fix Sonar Java Coverage
[clamp.git] / pom.xml
diff --git a/pom.xml b/pom.xml
index 83bc1d0..8d6e72c 100644 (file)
--- a/pom.xml
+++ b/pom.xml
 
                <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 -->
                        <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>
 
                <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>
                                        <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>