Answered in https://stackoverflow.com/a/54945556/244993

On Friday, March 1, 2019 at 1:26:04 PM UTC+1, [email protected] wrote:
>
> I have the following pom to create an aggregated jacoco report.
> I want to exclude some class files since those files do not want to get 
> considered.
> Pls, let me know how to do it.
>
>
> ----------------------------------------------------------------------------------
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0";
>          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
> http://maven.apache.org/xsd/maven-4.0.0.xsd";>
>
>     <modelVersion>4.0.0</modelVersion>
>     <groupId>wso2</groupId>
>     <artifactId>code-coverage-report</artifactId>
>     <packaging>pom</packaging>
>     <version>1.0-SNAPSHOT</version>
>
>     <build>
>         <directory>${project.basedir}/target</directory>
>     </build>
>
>     <profiles>
>         <profile>
>             <id>with-tests</id>
>             <activation>
>                 <property>
>                     <name>!maven.test.skip</name>
>                 </property>
>             </activation>
>             <build>
>                 <plugins>
>                     <plugin>
>                         <groupId>org.apache.maven.plugins</groupId>
>                         <artifactId>maven-dependency-plugin</artifactId>
>                         <executions>
>                             <execution>
>                                 <id>copy-jacoco-dependencies</id>
>                                 <phase>compile</phase>
>                                 <goals>
>                                     <goal>copy-dependencies</goal>
>                                 </goals>
>                                 <configuration>
>                                     
> <outputDirectory>${project.build.directory}</outputDirectory>
>                                     <includeTypes>jar</includeTypes>
>                                     
> <includeArtifactIds>org.jacoco.ant</includeArtifactIds>
>                                     <stripVersion>true</stripVersion>
>                                 </configuration>
>                             </execution>
>                         </executions>
>                     </plugin>
>
>                     <!-- Ant plugin - Merge Jacoco Reports -->
>                     <!-- Logging and distribution modules are not checked 
> since not relevant -->
>                     <plugin>
>                         <groupId>org.apache.maven.plugins</groupId>
>                         <artifactId>maven-antrun-plugin</artifactId>
>                         <version>1.8</version>
>                         <executions>
>                             <execution>
>                                 <phase>package</phase>
>                                 <goals>
>                                     <goal>run</goal>
>                                 </goals>
>                                 <configuration>
>                                     <target 
> xmlns:jacoco="antlib:org.jacoco.ant">
>                                         <taskdef 
> uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
>                                             <classpath 
> path="${project.build.directory}"/>
>                                         </taskdef>
>
>                                         <jacoco:merge 
> destfile="merged.exec">
>                                             <fileset dir="jacoco/exec/" 
> includes="*.exec"/>
>                                         </jacoco:merge>
>
>                                         <jacoco:report>
>                                             <executiondata>
>                                                 <file file="merged.exec"/>
>                                             </executiondata>
>                                             <structure name="Final 
> Coverage Report">
>                                                 <classfiles>
>                                                     <fileset 
> dir="jacoco/class/classes/"/>
>                                                 </classfiles>
>                                                 <excludes>
>                                                     
> **/org/xxx/carbon/dataservices/ui/stub/admin/*,
>                                                     
> **/org/xxx/carbon/rest/api/stub/types/aaa/*,
>                                                     
> **/org/xxx/carbon/endpoint/stub/types/aaa/*,
>                                                 </excludes>
>                                             </structure>
>                                             <html 
> destdir="jacoco/tmp_report"/>
>                                             <xml 
> destfile="jacoco/tmp_report/coverage-report.xml"/>
>                                             <csv 
> destfile="jacoco/tmp_report/coverage-report.csv"/>
>                                         </jacoco:report>
>                                     </target>
>                                 </configuration>
>                             </execution>
>                         </executions>
>                         <dependencies>
>                             <dependency>
>                                 <groupId>org.jacoco</groupId>
>                                 <artifactId>org.jacoco.ant</artifactId>
>                                 <version>${jacoco.version}</version>
>                             </dependency>
>                         </dependencies>
>                     </plugin>
>                 </plugins>
>             </build>
>         </profile>
>     </profiles>
>
>     <dependencies>
>         <dependency>
>             <groupId>org.jacoco</groupId>
>             <artifactId>org.jacoco.ant</artifactId>
>             <version>${jacoco.version}</version>
>             <scope>test</scope>
>         </dependency>
>     </dependencies>
>
>     <properties>
>         <jacoco.version>0.7.9</jacoco.version>
>     </properties>
>
> </project>
>
>

-- 
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/98d2b702-3770-4522-b64a-a25e98cf93e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to