Sonar requires an XML report instead of raw .exec file. Update
configuration to perform reporting.
Change-Id: Ia5c3d4bde87b05b6677767aaf1baeacf7f7b1673
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
<!-- JaCoCo configuration, by default tied to Sonar configuration, but can be overridden separately
to allow projects to report Sonar values from the entire project. -->
<jacoco.destFile>${project.build.directory}/code-coverage/jacoco.exec</jacoco.destFile>
+ <jacoco.dataFile>${jacoco.destFile}</jacoco.dataFile>
<!-- Default Sonar configuration -->
<sonar-jacoco-listeners.version>3.8</sonar-jacoco-listeners.version>
<goals>
<goal>prepare-agent</goal>
</goals>
- <configuration>
- <destFile>${jacoco.destFile}</destFile>
- </configuration>
+ </execution>
+ <execution>
+ <id>report</id>
+ <goals>
+ <goal>report</goal>
+ </goals>
</execution>
</executions>
</plugin>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
+ <!-- Step one:
+
+ merge all .exec files into a single file into this project's
+ ${project.build.directory}/jacoco.exec. Note we are being explicit so as
+ to override the odlparent/pom.xml override
+ -->
<id>merge</id>
<goals>
<goal>merge</goal>
</fileSets>
</configuration>
</execution>
+ <execution>
+ <!-- Step two:
+
+ pick the merged execution file and produce a complete aggregate report,
+ including HTML/XML/CSV.
+ -->
+ <id>report</id>
+ <goals>
+ <goal>report-aggregate</goal>
+ </goals>
+ <phase>generate-resources</phase>
+ <configuration>
+ <dataFileIncludes>${odl.jacoco.aggregateFile}</dataFileIncludes>
+ </configuration>
+ </execution>
</executions>
</plugin>
</plugins>