0

I have some utility classes in my java code. I wanted to exclude it from cobertura report and added exclude tag in my pom.xml. But it doesn't seems to be working. Is there any other way to exclude classes or whole package from the report?

  <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>cobertura-maven-plugin</artifactId>
    <configuration>
      <instrumentation>
        <excludes>
          <exclude>com/main/class/util*.class</exclude>
        </excludes>
      </instrumentation>
    </configuration>
  </plugin>
Nagendra
  • 191
  • 1
  • 3
  • 20

1 Answers1

0

along with above you have to exclude it from report like this

   <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.7</version>
                <configuration>

                    <instrumentation>
                        <excludes>
                            <exclude>**/soap/*.class</exclude>                      
                        </excludes>
                    </instrumentation>
                    <check></check>
                    <formats>
                        <format>html</format>
                        <format>xml</format>
                    </formats>
               </configuration>
            </plugin>
        </plugins>
    </build>
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.7</version>
                <configuration>

                    <instrumentation>
                        <excludes>
                            <exclude>**/soap/*.class</exclude>                      
                        </excludes>
                    </instrumentation>
                    <check></check>
                    <formats>
                        <format>html</format>
                        <format>xml</format>
                    </formats>
               </configuration>
            </plugin>
        </plugins>
    </reporting>
</project>