MavenカバレッジレポートからJavaファイルを除外するにはどうすればよいですか?


Java コードにいくつかのユーティリティ クラスがあります。カバレッジ レポートから除外したかったので、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>

タグ:

関連記事:

angularjs - リンクのクリックと遷移を区別する方法

ネットワーキング - 無線/有線サブネット間のひどい ping 時間