gpt4 book ai didi

maven - Jacoco Maven插件-生命周期配置未涵盖插件执行

转载 作者:行者123 更新时间:2023-12-03 12:37:10 26 4
gpt4 key购买 nike

我是Maven的新手,并且想使用Jacoco Maven插件来构建我的项目。

我已经建立了一个带有TestNG唯一依赖项的示例项目。

这是pom.xml的一部分:

<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.6.2.201302030002</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>


我得到这个错误:

生命周期配置未涵盖插件执行:org.jacoco:jacoco-maven-
插件:0.6.2.201302030002:准备代理(执行:默认,阶段:初始化)

我究竟做错了什么 ?
干杯

最佳答案

您可以忽略插件目标,在pom.xml中添加类似的内容

<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only.
It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<versionRange>[0.5,)
</versionRange>
<goals>
<goal>prepare-agent</goal>
</goals>
</pluginExecutionFilter>
<action>
<!-- m2e doesn't know what to do with jacoco,
let's ignore it or annoying error markers appear
see http://wiki.eclipse.org/M2E_plugin_execution_not_covered
-->
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>

关于maven - Jacoco Maven插件-生命周期配置未涵盖插件执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14843892/

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