How to add "merged" report to Maven site

182 views
Skip to first unread message

Christian Gendreau

unread,
Aug 16, 2018, 12:25:48 PM8/16/18
to JaCoCo and EclEmma Users
Hi,

I'm trying to configure the jacoco-maven-plugin to generate 3 reports (unit, integration and a merged report) and have them available in the index.html of the maven site plugin.

          <!-- Merge jacoco.exec from unit and integrations tests -->
         
<execution>
           
<id>merge-results</id>
           
<phase>verify</phase>
           
<goals>
             
<goal>merge</goal>
           
</goals>
           
<configuration>
             
<fileSets>
               
<fileSet>
                 
<directory>${project.build.directory}</directory>
                 
<includes>
                   
<include>*.exec</include>
                 
</includes>
                 
<excludes>
                   
<exclude>jacoco-aggregate.exec</exclude>
                 
</excludes>
               
</fileSet>
             
</fileSets>
             
<destFile>${project.build.directory}/jacoco-aggregate.exec</destFile>
           
</configuration>
         
</execution>

         
<execution>
           
<id>aggregate-report</id>
           
<phase>verify</phase>
           
<goals>
             
<goal>report</goal>
           
</goals>
           
<configuration>
             
<outputDirectory>${project.reporting.outputDirectory}/jacoco-aggregate</outputDirectory>
             
<dataFile>${project.build.directory}/jacoco-aggregate.exec</dataFile>
           
</configuration>
         
</execution>

The jacoco-aggregate folder will contain a merged report but if I add the following configuration in the report section of my pom:
      <plugin>
       
<groupId>org.jacoco</groupId>
       
<artifactId>jacoco-maven-plugin</artifactId>
     
</plugin>

I end up with an empty aggregate report since "report-aggregate" will generate a new report with all the .exec from my build folder.

If I use the following configuration:

      <plugin>
       
<groupId>org.jacoco</groupId>
       
<artifactId>jacoco-maven-plugin</artifactId>
       
<reportSets>
         
<reportSet>
           
<reports>
             
<report>report</report>
             
<report>report-integration</report>
           
</reports>
         
</reportSet>
       
</reportSets>
     
</plugin>

my merged report (in jacoco-aggregate folder) is still available but it is not picked up by the maven site since it's not in the reportSet.

So my question is: How could I add my "merged" report to the maven site without having jacoco-aggregate creating a new one?

Thanks!

Let me know if you need more information and/or snippets.


Evgeny Mandrikov

unread,
Aug 16, 2018, 2:13:39 PM8/16/18
to JaCoCo and EclEmma Users
Hi,

Created dedicated module for combined report that will use only "<report>report-aggregate</report>".

ggr...@gmail.com

unread,
Aug 28, 2018, 8:35:01 AM8/28/18
to JaCoCo and EclEmma Users
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages