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

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


当前回答

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

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

其他回答

谢谢你的回复,但经过更多的搜索,我能够解决这个问题。结果我不得不删除其中一个“*”。lastUpdated”,这是阻止我的一个插件(Maven Surefire插件)更新。我是手动清理的,因为清洁专家显然不会这么做。

问题是“*”。一个插件的lastUpdated文件阻止了maven检查更新,并且不允许下载必要的jar文件。

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

对我来说有效的解决方法如下:

将依赖项复制到pom。 < >的依赖 < groupId > org.apache.maven < / groupId > < artifactId > maven-archiver < / artifactId > <版本> 2.5版本> < / < / >的依赖 右击您的项目 选择Maven 选择更新项目 选择“强制更新快照/发布”

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

删除存储库中的所有文件。

转到c:\ users \ dell。M2 \资源库,选择所有文件并删除它。

然后转到项目,右键单击maven更新项目(Alt+F5)。它将下载存储库中的所有依赖文件。