我如何从Cobertura Report Maven中排除Java文件



我的Java代码中有一些实用程序类。我想将其排除在Cobertura报告中,并在我的pom.xml中添加了排除标签。但这似乎没有起作用。还有其他方法可以从报告中排除类或整个软件包吗?

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

以及上面您必须将其排除在这样的报告之外

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

最新更新