root pom.xml file
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.11</version>
<configuration>
<excludes>
<exclude>com/global/**/*</exclude>
<exclude>org/local/**/*</exclude>
<exclude>org/aws/**/*</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>report-aggregate</id>
<phase>verify</phase>
<goals>
<goal>report-aggregate</goal>
</goals>
<configuration>
<includeCurrentProject>true</includeCurrentProject>
</configuration>
</execution>
</executions>
</plugin>
<exclude> tag is used to exclude the package.
<includeCurrentProject> to include current module.
After this configuration run command -
mvn clean install This command will generate aggregated report for all the modules