Sonar Changes to pom file 77/31277/1
authorThomas Nelson Jr (arthurdent3) <tn1381@att.com>
Sun, 11 Feb 2018 22:17:53 +0000 (17:17 -0500)
committerThomas Nelson Jr (arthurdent3) <tn1381@att.com>
Sun, 11 Feb 2018 22:17:53 +0000 (17:17 -0500)
Trying to get Sonar working right. Code coverage is not showing up.
Assuming its somethign missing from pom.

Change-Id: I8a695ce6639666b79a2d92e4d5cb92307515a858
Issue-ID: MUSIC-24
Signed-off-by: Thomas Nelson Jr (arthurdent3) <tn1381@att.com>
.gitreview
pom.xml

index 70ebed7..01a85b4 100644 (file)
@@ -1,4 +1,4 @@
 [gerrit]
-host=gerrit.acumos.org
+host=gerrit.onap.org
 port=29418
 project=music.git
diff --git a/pom.xml b/pom.xml
index 9f72257..d547f20 100755 (executable)
--- a/pom.xml
+++ b/pom.xml
                <zookeeper.version>3.4.6</zookeeper.version>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                 <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+                <!-- ONAP Nexus -->
                 <nexusproxy>https://nexus.onap.org</nexusproxy>
                 <snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath>
                 <releaseNexusPath>/content/repositories/releases/</releaseNexusPath>
                 <stagingNexusPath>/content/repositories/staging/</stagingNexusPath>
                 <sitePath>/content/sites/site/org/openecomp/music/${project.version}</sitePath>
+                <!-- SONAR -->
+                <sonar.language>java</sonar.language>
+                <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
+                <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath>
+                <sonar.jacoco.reportPath>${project.build.directory}/code-coverage/jacoco-ut.exec</sonar.jacoco.reportPath>
+                <sonar.jacoco.reportMissing.force.zero>true</sonar.jacoco.reportMissing.force.zero>
+                <sonar.projectVersion>${project.version}</sonar.projectVersion>
+
        </properties>
        <repositories>
                <repository>
                             <artifactId>sonar-maven-plugin</artifactId>
                             <version>3.2</version>
                         </plugin>
-               </plugins>
+                <plugin>
+                       <groupId>org.jacoco</groupId>
+                       <artifactId>jacoco-maven-plugin</artifactId>
+                       <version>0.7.7.201606060606</version>
+                       <configuration>
+                               <dumpOnExit>true</dumpOnExit>
+                               <includes>
+                                       <include>org.openecomp.*</include>
+                               </includes>
+                       </configuration>
+                       <executions>
+                               <execution>
+                                       <id>jacoco-initialize-unit-tests</id>
+                                       <goals>
+                                               <goal>prepare-agent</goal>
+                                       </goals>
+                                       <configuration>
+                                               <destFile>${project.build.directory}/coverage-reports/jacoco.exec</destFile>
+                                               <!-- <append>true</append> -->
+                                       </configuration>
+                               </execution>
+                       </executions>
+                </plugin>
+                 <!-- Maven surefire plugin for testing -->
+                 <plugin>
+                     <artifactId>maven-surefire-plugin</artifactId>
+                     <version>2.17</version>
+                 </plugin>
+           </plugins>
        </build>
 
        <dependencies>