I have a large Maven multiproject build with PowerMock-based unit tests. I'm generating a "target/jacoco.exec" in the child modules, with plugin configuration in the overall parent pom for the child modules. I have an additional child module that just uses "report-aggregate", and which specifies the various child modules as dependencies. This all basically works.
I'm now trying to integrate this data with SonarQube. It appears that the version of the SonarQube Java Analyzer that is installed doesn't know how to handle multiple jacoco.exec files, it will only process a single one. So, I'm trying to get the "merge" goal to work. I read the docs on this goal, but I'm obviously not doing something correctly, as it's just not finding the data files.
In the same child module that I'm using "report-aggregate", I did the following:
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.8</version>
<executions>
<execution>
<id>report-aggregate</id>
<phase>verify</phase>
<goals>
<goal>report-aggregate</goal>
</goals>
</execution>
<execution>
<id>merge</id>
<goals>
<goal>merge</goal>
</goals>
<configuration>
<fileSets>
<fileSet>
<directory>../childmodule1/target</directory>
<include>*.exec</include>
</fileSet>
<fileSet>
<directory>../childmodule2/target</directory>
<include>*.exec</include>
</fileSet>
... several more
</fileSets>
</configuration>
</execution>
</executions>
</plugin>
When I ran "mvn clean install" from the top-level, it eventually processed the "jacoco-aggregate" child module, and produced the following output:
[INFO] ------------------------------------------------------------------------
[INFO] Building jacoco-aggregate 2.3.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ jacoco-aggregate ---
[INFO] Deleting ...\jacoco-aggregate\target
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.8:merge (merge) @ jacoco-aggregate ---
[INFO] Skipping JaCoCo merge execution due to missing execution data files
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (filter) @ jacoco-aggregate ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory ...\jacoco-aggregate\src\main\resources
[INFO]
[INFO] --- depends-maven-plugin:1.2:generate-depends-file (generate-depends-file) @ jacoco-aggregate ---
[INFO] Created: ...\jacoco-aggregate\target\classes\META-INF\maven\dependencies.properties
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.8:instrument (default-instrument) @ jacoco-aggregate ---
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.8:restore-instrumented-classes (default-restore-instrumented-classes) @ jacoco-aggregate ---
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.8:report (default-report) @ jacoco-aggregate ---
[INFO] Skipping JaCoCo execution due to missing execution data file.
[INFO]
[INFO] --- maven-javadoc-plugin:2.10.4:jar (module-javadoc-jar) @ jacoco-aggregate ---
[INFO] Not executing Javadoc as the project is not a Java classpath-capable package
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.8:report-aggregate (report-aggregate) @ jacoco-aggregate ---
[INFO] Loading execution data file ...\childmodule1\target\jacoco.exec
[INFO] Loading execution data file ...\childmodule2\target\jacoco.exec
... several more
[INFO] Analyzed bundle 'childmodule1' with 1 classes
[INFO] Analyzed bundle 'childmodule2' with 1 classes
As you can see, it executed the "merge" goal, but it didn't find any data files, even though the later "report-aggregate" goal did.
So I assume that the way I'm specifying the filesets, or something associated with it, is somehow wrong. What might be wrong here?