0
要成功運行我的單元測試,我必須爲JVM提供一些替換的標準類。因此,我用下面的配置maven-surefire-plugin
:如何用`-Xbootclasspath/p:my.jar`選項運行`jacoco-maven-plugin`?
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<skipTests>${skipUTs}</skipTests>
<argLine>-Xbootclasspath/p:my.jar</argLine>
</configuration>
</plugin>
plugin/configuration/argLine
添加,沒有什麼特別的。但我怎麼能告訴jacoco同樣的事情?該jacoco沒有configuration/argLine
:(
我已經在我的pom.xml文件配置如下Maven的JaCoCo插件:
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.5.201505241946</version>
<configuration>
<skip>${skipUTs}</skip>
<!-- NO ONE (((((
<argLine>-Xbootclasspath/p:my.jar</argLine>
-->
</configuration>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>default-check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule implementation="org.jacoco.maven.RuleConfiguration">
<element>BUNDLE</element>
<limits>
<limit implementation="org.jacoco.report.check.Limit">
<counter>COMPLEXITY</counter>
<value>COVEREDRATIO</value>
<minimum>1.0</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
可能的重複[無法在maven中使用jacoco JVM參數和surefire JVM參數](http://stackoverflow.com/questions/23190107/cannot-use-jacoco-jvm-args-and-surefire-jvm-args -together合行家) – Godin