This patch teaches the top-level aggregator to combine jacoco
reports for all artifacts, so that sonar can pick it up.
Change-Id: Ie116fcb069b6c384783f0a3f751eb15186dd42ff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
</plugins>
</reporting>
- <profiles>
- <profile>
- <id>karaf</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
+ <profiles>
+ <profile>
+ <id>karaf</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
- <modules>
- <module>distribution-karaf</module>
- </modules>
- </profile>
- </profiles>
+ <modules>
+ <module>distribution-karaf</module>
+ </modules>
+ </profile>
+ <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>