eclipse 转移依赖失败,缓存在本地仓库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10684311/
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
Failure to transfer dependency, was cached in the local repository
提问by Mahmoud Saleh
I am working on maven 2 project on eclipse, and I have the m2e plugin, and I am getting the following error in Eclipse:
我正在 Eclipse 上处理 maven 2 项目,并且我有 m2e 插件,但在 Eclipse 中出现以下错误:
Failure to transfer com.thoughtworks.xstream:xstream:pom:1.3.1 from http://repo1.maven.org/maven2 was cached in the
local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced.
Original error: Could not transfer artifact com.thoughtworks.xstream:xstream:pom:1.3.1 from/to central (http://
repo1.maven.org/maven2): Failed to create a selector. to http://repo1.maven.org/maven2/com/thoughtworks/xstream/
xstream/1.3.1/xstream-1.3.1.pom
I followed answers on similar problem by removing .lastUpdatedfile then clean and build with no luck, still getting same error, please advise.
我通过删除.lastUpdated文件然后清理并构建但没有运气来遵循类似问题的答案,仍然遇到相同的错误,请指教。
回答by Mahmoud Saleh
problem fixed after deleting the .lastUpdated file and the dependency then downloading it again.
删除 .lastUpdated 文件和依赖项然后再次下载后问题已解决。
回答by Akshay Kadam
Error occured beacuse of Old cache of Maven tool is present in your directory. So you must delete it. Go to C\User\"your user name"\m2 then delete it.
由于 Maven 工具的旧缓存存在于您的目录中,因此发生错误。所以你必须删除它。转到 C\User\"您的用户名"\m2 然后将其删除。
回答by Liping Huang
You can use -U
parameter to force a check for the updated releases and snapshots on remote
repositories, and resolve this issue.
您可以使用-U
参数强制检查远程存储库上的更新版本和快照,并解决此问题。
Actually you can find this solution by using mvn -h
to show Maven help.
实际上,您可以通过使用mvn -h
来显示 Maven 帮助来找到此解决方案。
回答by nitin khatawate
If you are using Eclipse:
如果您使用的是 Eclipse:
Go to
Window->Preferences->Maven
:
check the download artifact source code, artifact javadoc, update maven project on startup.In the folder that contains pom.xml, run:
mvn clean install -U
去
Window->Preferences->Maven
:
检查下载神器源代码,神器javadoc,启动时更新maven项目。在包含 pom.xml 的文件夹中,运行:
mvn clean install -U
It worked for me :).
它对我有用:)。