Add handling for aggregater sonar reports 33/78233/2
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 27 Nov 2018 23:25:50 +0000 (00:25 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 28 Nov 2018 00:10:57 +0000 (01:10 +0100)
This adds the maven-side of things for having UT coverage
aggregated for the entire project.

Change-Id: I215dd159d96941a487ce80d70ea468dd0d6e0390
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
pom.xml

diff --git a/pom.xml b/pom.xml
index 591144c3c2e3ae147538fd7785a0acf235547dac..c372c98380e8d31d272777958a44b54b5ebf8e09 100644 (file)
--- a/pom.xml
+++ b/pom.xml
         <module>restconf</module>
     </modules>
 
+    <profiles>
+        <profile>
+            <id>sonar-jacoco-aggregate</id>
+            <activation>
+                <property>
+                    <name>odl.jacoco.aggregateFile</name>
+                </property>
+            </activation>
+            <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>
+                                    <destFile>${odl.jacoco.aggregateFile}</destFile>
+                                    <fileSets>
+                                        <fileSet>
+                                            <directory>${project.basedir}</directory>
+                                            <includes>
+                                                <include>**/target/code-coverage/*.exec</include>
+                                            </includes>
+                                        </fileSet>
+                                    </fileSets>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 </project>