我试图使用Maven (m2eclipse)建立一个项目,但我在Eclipse中得到这个错误:

Description Resource Path Location Type Could not calculate build plan: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.0.2 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 org.apache.maven.plugins:maven-compiler-plugin:pom:2.0.2 from/to central (http://repo1.maven.org/maven2): No response received after 60000 ExampleProject Unknown Maven Problem

什么好主意吗? 如果你能告诉我如何检查是否一切配置正常,那就太有帮助了。


当前回答

尝试执行

mvn -U clean

或者在eclipse中运行> Maven Clean和Maven >更新项目上下文菜单中的快照

其他回答

当我在防火墙后面时,它发生在我身上。在Eclipse IDE中运行时,有时不会下载依赖项。确保使用mvn clean install -U来解决这个问题。在此之后,您将看到依赖项下载。

尝试执行

mvn -U clean

或者在eclipse中运行> Maven Clean和Maven >更新项目上下文菜单中的快照

这在Windows中也适用。

Locate the {user}/.m2/repository (Using Juno /Win7 here) In the Search field in upper right of window, type ".lastupdated". Windows will look through all subfolders for these files in the directory. (I did not look through cache.) Remove them by Right-click > Delete (I kept all of the lastupdated.properties). Then go back into Eclipse, Right-click on the project and select Maven > Update Project. I selected to "Force Update of Snapshots/Releases". Click Ok and the dependencies finally resolved correctly.

设置。xml代理? 在eclipse中有maven全局\本地配置文件,添加settings.xml

对于mac

我删除了所有旧的maven失败的下载,在我的mac上也有几个版本的maven

寻找~ /。M2 -name "*。lastUpdated" -exec grep -q " cannot transfer" {};-print -exec rm {};

之后,我简单地更新了我的eclipse

帮助->检查更新

这个问题为我解决了

这个问题的主要原因是失败的旧更新不允许你下载原型,所以如果你试图在maven的任何原型中构建项目,它会失败