我想以某种方式使用 Jacoco,以便将 aSample.java class
从整体覆盖范围中排除。为了实现这一点,我已将目标包含<exclude>
在prepare-agent
maven pom.xml 中
Jacoco 插件:
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.1.201405082137</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
Surefire 插件:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.3</version>
<configuration>
<excludes>
<exclude>**/*Sample.java</exclude>
</excludes>
</configuration>
</plugin>
属性部分:
<properties>
<argLine>-Dfile.encoding=ISO-8859-1</argLine>
</properties>