我试图使用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

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


当前回答

由于删除了'maven-compiler-plugin 2.0.2'而出现上述错误 来自maven存储库。 对我来说,当我将'maven-compiler-plugin'降级到2.0或2.0.1版本时,上述错误得到了解决。

其他回答

请确保。m2文件夹中的settings.XML文件是有效的 然后在cmd中使用以下命令清理存储库

cd %userprofile%\.m2\repository
for /r %i in (*.lastUpdated) do del %i

尝试执行

mvn -U clean

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

由于删除了'maven-compiler-plugin 2.0.2'而出现上述错误 来自maven存储库。 对我来说,当我将'maven-compiler-plugin'降级到2.0或2.0.1版本时,上述错误得到了解决。

我的工作空间里只有几个项目也有类似的问题。其他具有几乎相同pom的项目根本没有错误。列出的其他答案都不能解决我的问题。我最终无意中为每个项目删除/重新应用Maven特性,错误消失了:

对于每个项目,有一个pom与“决议将不会被重新尝试…”错误:

在Eclipse中右键单击项目并选择Maven->Disable Maven Nature 右键单击Eclipse中的项目并选择Configure->Convert to Maven project

这在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.