Fix UT coverage not reported in sonar 31/9731/1
authorRobert Varga <rovarga@cisco.com>
Wed, 6 Aug 2014 04:56:27 +0000 (06:56 +0200)
committerRobert Varga <rovarga@cisco.com>
Wed, 6 Aug 2014 04:56:27 +0000 (06:56 +0200)
Just a couple of properties and making sure jacoco runs.

Change-Id: I75aeae7b74f5c7e94a0a237728dc2b6f0c4df090
Signed-off-by: Robert Varga <rovarga@cisco.com>
pom.xml

diff --git a/pom.xml b/pom.xml
index 59cfa196a50474f44565cf442fa2e2b704287355..c8808c2b39cef4f39783511a8693fb1a5ab98e59 100644 (file)
--- a/pom.xml
+++ b/pom.xml
         <releaseplugin.version>2.3.2</releaseplugin.version>
         <yangtools.version>0.6.2-SNAPSHOT</yangtools.version>
         <yangtools.generator.version>0.6.2-SNAPSHOT</yangtools.generator.version>
-        <config.version>0.2.5-SNAPSHOT</config.version>
+       <config.version>0.2.5-SNAPSHOT</config.version>
+
+        <!-- Sonar config -->
+        <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
+        <sonar.jacoco.reportPath>target/code-coverage/jacoco.exec</sonar.jacoco.reportPath>
     </properties>
 
     <pluginRepositories>
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <groupId>org.jacoco</groupId>
+                <artifactId>jacoco-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>prepare-agent</goal>
+                        </goals>
+                        <configuration>
+                            <destFile>${sonar.jacoco.reportPath}</destFile>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
             <plugin>
               <groupId>org.apache.felix</groupId>
               <artifactId>maven-bundle-plugin</artifactId>