Java 如何解决 maven 2.6 资源插件依赖?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31316339/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to solve maven 2.6 resource plugin dependency?
提问by spt025
ERROR:
错误:
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
Solutions Tried:
尝试的解决方案:
Updated project: not able to download from REPO of maven.
更新项目:无法从 maven 的 REPO 下载。
Tried putting perticular jar in that folder of .m2 repo.
尝试将特定的 jar 放在 .m2 存储库的那个文件夹中。
Can provide references if you want.
如果需要,可以提供参考。
采纳答案by Kalyan Chavali
Seems your settings.xml
file is missing your .m2 (local maven repo) folder.
似乎您的settings.xml
文件缺少 .m2(本地 Maven 存储库)文件夹。
When using eclipse navigate to Window -> Preferences -> Maven -> User Settings -> Browse to your settings.xml
and click apply.
使用 eclipse 时,导航到 Window -> Preferences -> Maven -> User Settings -> Browse to yoursettings.xml
并单击应用。
Then do maven Update Project.
然后做maven更新项目。
回答by Pim Verkerk
If a download fails for some reason Maven will not try to download it within a certain time frame (it leaves a file with a timestamp).
如果由于某种原因下载失败,Maven 将不会尝试在特定时间范围内下载它(它会留下带有时间戳的文件)。
To fix this you can either
要解决此问题,您可以
- Clear (parts of) your .m2 repo
- Run maven with -U to force an update
- 清除(部分)您的 .m2 存储库
- 使用 -U 运行 maven 以强制更新
回答by Douglas Tondo
On windows:
在窗户上:
- Remove folder from C:\Users\USER.m2
- Close and open the project or force a change on file: pom.xml for saving :)
- 从 C:\Users\USER.m2 中删除文件夹
- 关闭并打开项目或强制更改文件:pom.xml 以进行保存:)
回答by Shubham Verma
Step 1 : Check the proxy configured in eclipse is correct or not ? (Window->Preferences->General->Network Connections).
第一步:检查eclipse中配置的proxy是否正确?(窗口->首选项->常规->网络连接)。
Step 2 : Right Click on Project-> Go to Maven -> Update the project
第 2 步:右键单击 Project-> Go to Maven -> Update the project
Step 3: Run as Maven Install.
第 3 步:作为 Maven 安装运行。
==== By Following these steps, i am able to solve this error.
==== 按照这些步骤,我能够解决这个错误。
回答by Pardeep Dogra
I have faced the same issue. Try declaring missing plugin in the conf/settings.xml.
我遇到了同样的问题。尝试在 conf/settings.xml 中声明缺少的插件。
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</pluginManagement>
</build>
回答by halim
I had exactly the same error. My network is an internal one of a company. I downloaded neon-eclipse for java developpers. These steps worked for me:
我有完全相同的错误。我的网络是一家公司的内部网络。我为java开发人员下载了neon-eclipse。这些步骤对我有用:
1- I downloaded a VPN client on my PC to be totally blinded from the network. ShellfireI used. Use free account and connect to Shellserver.
1- 我在我的 PC 上下载了一个 VPN 客户端,完全无法访问网络。我用的炮弹。使用免费帐户并连接到 Shellserver。
2- Inside the windows firewall, I added incoming rule for Eclipse. Navigate to where eclipse exe is found.
2- 在 Windows 防火墙内,我为 Eclipse 添加了传入规则。导航到找到 eclipse exe 的位置。
3- Perform Maven Update project.
3- 执行 Maven 更新项目。
Then the project was able to fetch from the maven repository.
然后该项目能够从 Maven 存储库中获取。
hope it helps.
希望能帮助到你。
回答by Vinayak
Right Click on Project go to -> Maven -> Update project ->select Force update project check box and click on Finish.
右键单击项目转到 -> Maven -> 更新项目 -> 选择强制更新项目复选框并单击完成。
回答by Aru Arshad
Tried everything. I deleted m2e and installed m2e version 2.7.0. Then deleted the .m2 directory and force updated maven. It worked!
尝试了一切。我删除了 m2e 并安装了 m2e 版本 2.7.0。然后删除.m2目录并强制更新maven。有效!
回答by bartleonid
This fixed the same issue for me:
My eclipse is installed in /usr/local/bin/eclipse
这为我解决了同样的问题:我的 eclipse 安装在 /usr/local/bin/eclipse
1) Changed permission for eclipse from root to owner: sudo chown -R $USER eclipse
1) 将 eclipse 的权限从 root 更改为 owner: sudo chown -R $USER eclipse
2) Right click on project/Maven
right click on Update Maven
select Force update maven project
2)右键单击project/Maven
右键单击Update Maven
选择Force update maven project
回答by Vijay Pratap
I had exactly the same error. My network is an internal one of a company. The proxy has been disabled from the IT team so for that we do not have to enable any proxy settings. I have commented the proxy setting in settings.xml file from the below mentioned locations C:\Users\vijay.singh.m2\settings.xml This fixed the same issue for me
我有完全相同的错误。我的网络是一家公司的内部网络。IT 团队已禁用代理,因此我们不必启用任何代理设置。我在下面提到的位置 C:\Users\vijay.singh.m2\settings.xml 中评论了 settings.xml 文件中的代理设置这为我解决了同样的问题