Fix Sonar integration
[yangtools.git] / common / testutils / pom.xml
index dad58d8cc5ce5465c5515f2d314a87bcedbf7302..20218972d222f0a54ba207f16c9fecb5cb925d77 100644 (file)
     <version>2.1.0-SNAPSHOT</version>
     <!-- Currently not needed, maybe later: <packaging>bundle</packaging> -->
 
+    <properties>
+        <sonar.jacoco.reportPath>${project.basedir}/../../target/jacoco.exec</sonar.jacoco.reportPath>
+    </properties>
+
     <dependencyManagement>
         <dependencies>
             <dependency>
                     <failOnError>true</failOnError>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.jacoco</groupId>
+                <artifactId>jacoco-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>pre-unit-test</id>
+                        <goals>
+                            <goal>prepare-agent</goal>
+                        </goals>
+                        <configuration>
+                            <destFile>${project.build.directory}/code-coverage/jacoco.exec</destFile>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>