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 
<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



> On 10. Sep 2020, at 18:05, vinay singh <vinays.si...@gmail.com> wrote:
> 
> 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?
> 
> On Tuesday, September 8, 2020 at 8:11:43 AM UTC-4 vinay singh wrote:
> 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? 
> 
> -- 
> 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+unsubscr...@googlegroups.com 
> <mailto:jacoco+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jacoco/f7300135-14e8-4f9e-ad6d-c403c3f77171n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jacoco/f7300135-14e8-4f9e-ad6d-c403c3f77171n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/6AA6B6E0-6E9E-4C22-86D8-EC29BCD94738%40mountainminds.com.

Reply via email to