Experiment: aggregate jacoco for sonar
[yangtools.git] / pom.xml
diff --git a/pom.xml b/pom.xml
index c08d2a7029061e4ef3fba74e72ed96f3732b6f64..d604a681fecedfa92c314c4f5fa24342e37e9bdd 100644 (file)
--- a/pom.xml
+++ b/pom.xml
         <tag>HEAD</tag>
     </scm>
 
+    <properties>
+        <sonar.jacoco.reportPath>${project.build.directory}/jacoco.exec</sonar.jacoco.reportPath>
+    </properties>
+
     <modules>
         <module>artifacts</module>
         <module>benchmarks</module>
         <module>third-party</module>
     </modules>
 
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.jacoco</groupId>
+                <artifactId>jacoco-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>merge</id>
+                        <goals>
+                            <goal>merge</goal>
+                        </goals>
+                        <phase>generate-resources</phase>
+                        <configuration>
+                            <fileSets>
+                                <fileSet>
+                                    <directory>${project.basedir}</directory>
+                                    <includes>
+                                        <include>common/*/target/code-coverage/*.exec</include>
+                                        <include>third-party/*/target/code-coverage/*.exec</include>
+                                        <include>yang/*/target/code-coverage/*.exec</include>
+                                    </includes>
+                                </fileSet>
+                            </fileSets>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
     <profiles>
       <profile>
         <!--