On Friday, May 17, 2019 at 9:29:47 PM UTC+2, Fagner Fernandes wrote:
>
> Hi everyone,
>
> Even after reading Jacoco Aggregate Report I'm still struggling to 
> configure Jacoco with Maven Multimodule configuration and send all data to 
> Sonar (7.7). I'm using Spring Boot with Spring Cloud.
>
> Currently, I have this structure on my application:
>
> Parent
>  - commons-module
>  - eureka-module
>  - module-a
>  - module-b
>  - module-c
>  - module-d
>  - module-e
>  - module-f
>
> Under build section, I'm using this configuration (jacoco.version=0.8.4):
>
> <plugin>
> <groupId>org.jacoco</groupId>
> <artifactId>jacoco-maven-plugin</artifactId>
> <version>${jacoco.version}</version>
> <executions>
> <execution>
> <id>default-prepare-agent</id>
> <goals>
> <goal>prepare-agent</goal>
> </goals>
> </execution>
> <execution>
> <id>default-report</id>
> <goals>
> <goal>report</goal>
> </goals>
> </execution>
> <execution>
> <id>default-check</id>
> <goals>
> <goal>check</goal>
> </goals>
> <configuration>
> <rules>
> <rule>
> <element>BUNDLE</element>
> <limits>
> <limit>
> <counter>COMPLEXITY</counter>
> <value>COVEREDRATIO</value>
> <minimum>0.60</minimum>
> </limit>
> </limits>
> </rule>
> </rules>
> </configuration>
> </execution>
> </executions>
> </plugin>
>
> And after running mvn jacoco:report-aggregate, I get this result:
>
>
> Element Missed Instructions Cov. Missed Branches Cov.
> Total 0 of 0 n/a 0 of 0 n/a
>
> So what I have done wrong?
>
>
Execution of

mvn jacoco:report-aggregate

results in execution of 
https://www.jacoco.org/jacoco/trunk/doc/report-aggregate-mojo.html for each 
module,
above documentation states:

The report is created from all modules this project depends on. From those 
projects class and source files as well as JaCoCo execution data files will 
be collected.

What refers to "dependencies" section of pom.xml
Unlikely that your "Parent" specifies "dependencies", so 
"target/site/jacoco-aggregate/" is empty as expected.
If your "module-a" for example has "commons-module" in its dependencies, 
then expect that "module-a/target/site/jacoco-aggregate" is not empty.

"report-aggregate" is not intended to be triggered from command-line, but 
to be declared in a dedicated module and bound to same phase - for example
https://github.com/jacoco/jacoco/blob/v0.8.4/jacoco-maven-plugin.test/it/it-report-aggregate/report/pom.xml#L25-L62
or
https://github.com/jacoco/jacoco/blob/v0.8.4/org.jacoco.doc/pom.xml#L121-L145
or
https://stackoverflow.com/questions/41885772/jacoco-simple-integration-test-solution/41901853#41901853

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/afc877ca-d6f8-4bcd-9fc0-51bffa3cb99a%40googlegroups.com.

Reply via email to