gpt4 book ai didi

eclipse - m2e 不支持 maven-dependency-plugin (目标 "copy-dependencies"、 "unpack")

转载 作者:行者123 更新时间:2023-12-03 04:20:30 28 4
gpt4 key购买 nike

我有一个相当简单的 Maven 项目:

<project>
<dependencies>
...
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/dependencies</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

但是,我在 m2eclipse 中收到以下错误:

Description Resource    Path    Location    Type
maven-dependency-plugin (goals "copy-dependencies", "unpack") is not supported by m2e. pom.xml /jasperreports-test line 60 Maven Project Build Lifecycle Mapping Problem

为什么我关心 m2eclipse 是否不“支持”这个任务? Maven 做到了,这就是我真正关心的。我怎样才能让我的项目中的这个错误消失?

最佳答案

这似乎是一个已知问题。您可以指示 m2e 忽略它。

选项 1:pom.xml

<build/> 中添加以下内容标签:

<pluginManagement>
<plugins>
<!-- Ignore/Execute plugin execution -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<!-- copy-dependency plugin -->
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<versionRange>[1.0.0,)</versionRange>
<goals>
<goal>copy-dependencies</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins></pluginManagement>

在此之后,您将需要对您的项目执行 Maven... -> 更新项目配置。

了解更多:http://wiki.eclipse.org/M2E_plugin_execution_not_covered#m2e_maven_plugin_coverage_status

选项 2:全局 Eclipse 覆盖

为了避免更改 POM 文件,可以通过 Eclipse 设置将忽略覆盖应用于整个工作区。

将此文件保存在磁盘上的某个位置:https://gist.github.com/maksimov/8906462

Eclipse/Preferences/Maven/Lifecycle Mappings浏览到此文件并单击“确定”:

Eclipse Settings

关于eclipse - m2e 不支持 maven-dependency-plugin (目标 "copy-dependencies"、 "unpack"),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8706017/

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