gpt4 book ai didi

maven - 由于缺少执行数据错误而跳过 JaCoCo 执行

转载 作者:行者123 更新时间:2023-12-04 01:23:43 24 4
gpt4 key购买 nike

我得到

Skipping JaCoCo execution due to missing execution data file:/scratch/jenkins/workspace/sonar-test/target/jacoco.exec error



我的 pom 个人资料是:
    <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 插件配置中。
示例:

        <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插件添加其他参数:
<argLine>${argLine} -XX:PermSize=128m -XX:MaxPermSize=512m</argLine>

关于maven - 由于缺少执行数据错误而跳过 JaCoCo 执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25373452/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com