由于缺少执行数据错误而跳过JaCoCo执行 [英] Skipping JaCoCo execution due to missing execution data error
本文介绍了由于缺少执行数据错误而跳过JaCoCo执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我得到
由于缺少执行数据文件而跳过JaCoCo执行:/ scratch / jenkins / workspace / sonar-test / target /jacoco.exec错误
Skipping JaCoCo execution due to missing execution data file:/scratch/jenkins/workspace/sonar-test/target/jacoco.exec error
我的pom配置文件为:
My pom profile is:
<profile>
<id>test-coverage</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
<configuration combine.self="override">
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<testFailureIgnore>true</testFailureIgnore>
<groups>com.project.test.annotation.QuickTest</groups>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.1.201405082137</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
我想念什么?
推荐答案
您需要将$ {argLine}添加到surefire插件配置中。
示例:
You need to add ${argLine} to surefire plugin configuration. Example:
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.1.201405082137</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.14.1</version>
<configuration>
<argLine>${argLine}</argLine>
</configuration>
</plugin>
</plugins>
</build>
如果您愿意,可以将其他参数添加到surefire插件中,如下所示:
If you want you can add other params to the surefire plugin like that:
<argLine>${argLine} -XX:PermSize=128m -XX:MaxPermSize=512m</argLine>
这篇关于由于缺少执行数据错误而跳过JaCoCo执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文