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

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


当前回答

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

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

其他回答

在eclipse中给出正确的maven settings .xml路径。

Windows——>首选项——> Maven——>用户设置

在“用户设置”文本框中输入正确的“setting.xml”路径

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

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

在我的例子中,我在spring工具4中得到了这个错误消息

ArtifactTransferException: org.codehaus.plexus:plexus-interpolation:jar:1.26 failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.codehaus.plexus:plexus-interpolation:jar:1.26 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org java.lang.reflect.InvocationTargetException

这是解决方案

步骤01 -首先关闭弹簧工具应用程序

步骤02 -进入路径C:\Users\User并删除。m2文件夹

步骤03 -现在去包探索和选择你的项目

第04步-现在右键单击您的项目,进入Maven,单击更新项目

如何卸载Spring Tool 4

步骤01 -单击帮助并转到关于Spring工具套件4

步骤02 -现在点击安装细节

步骤03 -在里面,你可以看到所有已安装的软件,只需按Ctrl + A选择所有,然后单击卸载

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

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