Not getting aggrgetaed report - running from command line

29 views
Skip to first unread message

vinay singh

unread,
Sep 8, 2020, 8:11:43 AM9/8/20
to JaCoCo and EclEmma Users
Hi,
I have a diffeernt use case for jacoco. We are running seleneium automation and recording the coverage through jacoco. The path to jacoc jar file is at the jvm command line during tomcat startup.
We take this exce file and run jacoco command from command line against the source code to generate the report. 

mvn org.jacoco:jacoco-maven-plugin:0.8.5:report -Djacoco.dataFile=/location/jacoco.exec   
Working good so far and I can see the coverage in respective modules. 

I want to get an aggregated coverage report for all the modules. I created a a new module and defined this in pom.xml

<build>
<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>report-aggregate</id>
<phase>verify</phase>
<goals>
<goal>report-aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

  
Now if I run the following from command line 
mvn org.jacoco:jacoco-maven-plugin:0.8.5:report-aggregate -Djacoco.dataFile=/location/jacoco.exec 

I would expect to see an aggrgeated report. I think I am running from command line but the definition is in the pom and that is why jacoco fails to detect aggregated module? 

vinay singh

unread,
Sep 10, 2020, 12:05:38 PM9/10/20
to JaCoCo and EclEmma Users
I have seen people getting the aggregated coverage report from the respective modules. I have defined a module which aggregates other modules in pom.xml.
But I think this will not work when we are supplying an input .exec file. I think I should be using an ant task to create an aggregated report.
Am I going in the right direction?

Marc Hoffmann

unread,
Sep 11, 2020, 1:50:26 AM9/11/20
to jac...@googlegroups.com
Hi Vinays,


the report-aggregate goal creates a coverage report for dependant modules. So you need to declare dependencies on the modules you want to create coverage reports for. Also exec data is collected form these modules. See documentation: https://www.jacoco.org/jacoco/trunk/doc/report-aggregate-mojo.html

Yes, the Ant tasks provides way more flexibility as you can flexibly define input sources (class files, source files and exec files) and also create arbitrary groups.

Regards,
-marc



-- 
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 jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/f7300135-14e8-4f9e-ad6d-c403c3f77171n%40googlegroups.com.

vinay singh

unread,
Sep 11, 2020, 11:47:31 AM9/11/20
to JaCoCo and EclEmma Users
Thanks Marc. I used ant task instead of maven and that gives me the output. 
Reply all
Reply to author
Forward
0 new messages