【发布时间】:2013-01-12 20:28:26
【问题描述】:
我正在关注一个很棒的教程:http://www.objectdb.com/tutorial/jpa/eclipse/spring/project
在复制 pom.xml 的代码后的第一步,我收到 9 个错误。这是我的 pom.xml 第 1 行显示的错误:
Failure to transfer org.apache.maven.reporting:maven-reporting-api:jar:2.0.6 from http://repo.maven.apache.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 org.apache.maven.reporting:maven-reporting-api:jar:2.0.6 from/to central (http://repo.maven.apache.org/maven2): The operation was cancelled. pom.xml /Guestbook line 1 Maven Configuration Problem
如有必要,我可以发布其他错误。在此之前我尝试过运行一些简单的预制 maven 项目,我相信他们称它们为 archtypes。他们有类似的错误。我不明白为什么会发生这种情况,而且我无法得到一些不立即抛出错误的 hello world 东西。
【问题讨论】:
-
只需删除语言环境存储库 .m2/repository 并重试即可。你是在代理还是其他什么背后?
-
我在家里做这个项目,我不应该在代理后面。我找不到 .m2 文件夹。我用 ls -a 搜索了我的 Eclipse 项目文件夹。
-
我找到了 .m2 项目,将其删除,然后更新了我的项目。所有的错误都像魔术一样消失了。谢谢:)
-
删除 .m2 存储库是黑魔法。在这种情况下它“起作用”的原因是它消除了在 Maven 中持续 24 小时的缓存工件解析失败。请参阅下面的答案。
标签: eclipse maven m2eclipse pom.xml