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

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


当前回答

我在Eclipse 3.6和m2eclipse中有类似的问题。

无法计算构建计划:未能将org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3从http://repo1.maven.org/maven2传输到本地存储库中,直到central的更新间隔已过或强制更新,才会重新尝试解决方案。原始错误:无法从中心转移工件org.apache.maven.plugins: Maven -resources-plugin:jar:2.4.3 (http://repo1.maven.org/maven2): ConnectException project1未知Maven问题

删除所有maven*。来自本地存储库的lastUpdated文件(正如Deepak Joy建议的那样)解决了这个问题。

其他回答

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

我在Eclipse 3.6和m2eclipse中有类似的问题。

无法计算构建计划:未能将org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3从http://repo1.maven.org/maven2传输到本地存储库中,直到central的更新间隔已过或强制更新,才会重新尝试解决方案。原始错误:无法从中心转移工件org.apache.maven.plugins: Maven -resources-plugin:jar:2.4.3 (http://repo1.maven.org/maven2): ConnectException project1未知Maven问题

删除所有maven*。来自本地存储库的lastUpdated文件(正如Deepak Joy建议的那样)解决了这个问题。

我得到这个错误的插件如下:

<groupId>org.codehaus.mojo</groupId>  
<artifactId>jaxb2-maven-plugin</artifactId>  
<version>2.5</version>  

我修改标签版本为:

<version>2.5.0</version>  

然后在eclipse中打开项目的上下文菜单,选择Maven >“更新项目…”,确保对话框中选中了“更新依赖项”,然后点击“确定”按钮。

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

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

只需删除maven本地存储库中的原型。如上所述,它发生在原型下载失败的情况下。