错误:
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
尝试过的解决方案:
更新的项目:无法从maven的REPO下载。
尝试将特定的 jar 放入 .m2 存储库的文件夹中。
如果需要可以提供参考。
似乎您的
settings.xml
文件缺少 .m2 (本地 Maven 存储库)文件夹。
使用 Eclipse 时,导航至 Window -> Preferences -> Maven -> User Settings -> Browse 到您的
settings.xml
并单击 apply。
然后进行maven更新项目。
右键单击项目,转到 -> Maven -> 更新项目 -> 选择强制更新项目复选框,然后单击完成。
我也遇到过同样的问题。尝试在conf/settings.xml中声明缺少的插件。
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</pluginManagement>
</build>
在 Windows 上:
如果由于某种原因下载失败,Maven 将不会尝试在特定时间范围内下载它(它会留下带有时间戳的文件)。
要解决此问题,您可以
第一步:检查eclipse中配置的代理是否正确? (窗口->首选项->常规->网络连接)。
第 2 步:右键单击项目 -> 转到 Maven -> 更新项目
第 3 步:作为 Maven 安装运行。
==== 通过遵循这些步骤,我能够解决这个错误。
这为我解决了同样的问题: 我的eclipse安装在
/usr/local/bin/eclipse
1)将 Eclipse 的权限从 root 更改为所有者:
sudo chown -R $USER eclipse
2) 右键单击
project/Maven
右键单击Update Maven
选择Force update maven project
我有完全相同的错误。我的网络是一家公司的内部网络。 IT 团队已禁用代理,因此我们不必启用任何代理设置。我已从下面提到的位置 C:\Users ijay.singh.m2\settings.xml 注释了 settings.xml 文件中的代理设置 这为我解决了同样的问题
This issue is happening due to change of protocol from http to https for central repository. please refer following link for more details. https://support.sonatype.com/hc/en-us/articles/360041287334-Central-501-HTTPS-Required
In order to fix the problem, copy following into your pom.ml file. This will set the repository url to use https.
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
</pluginRepository>
</pluginRepositories>
我有完全相同的错误。我的网络是一家公司的内部网络。我为 java 开发人员下载了 neon-eclipse。这些步骤对我有用:
1-我在我的电脑上下载了一个 VPN 客户端,以完全屏蔽网络。 Shellfire我用过。使用免费帐户并连接到 Shellserver。
2- 在 Windows 防火墙内,我添加了 Eclipse 的传入规则。导航到找到 eclipse exe 的位置。
3- 执行 Maven 更新项目。
然后该项目就可以从maven存储库中获取了。
希望有帮助。
什么都试过了。我删除了m2e并安装了m2e版本2.7.0。然后删除.m2目录并强制更新maven。有效!
在 Package Explorer > Maven > Update Project 下右键单击您的项目 > 选择“强制更新快照/版本”复选框 > 单击“确定”
这样你就不必到处搜索你的maven的settings.xml,如果原因是其他原因,Eclipse将自动处理它,无论它是什么。
mvn -Dhttps.protocols=TLSv1.2 安装
我遇到了同样的问题,通过删除我创建的项目,然后删除本地中的M2文件夹来解决。
我遇到了类似的问题并通过以下更新解决了
希望有帮助
如果您使用 jenkins 和 Sonatype Nexus 存储库:
更新pom.xml:
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
</plugin>
</plugins>
在 Jenkins --> 管理 Jenkins --> 工具中更新 Maven 版本:Maven 版本 3.2.5
登录Jenkins服务器并删除.m2文件夹(/jenkins/.m2/)
如果您已连接到 VPN,请断开连接,然后再尝试。