0

我的 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>
4

1 回答 1

0

连同上面你必须从这样的报告中排除它

   <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>
于 2017-03-22T06:51:27.910 回答