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

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


当前回答

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

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

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

其他回答

这件事也发生在我身上,对此你可能有两种解决办法

If your project consist of some external or project specificdependency in it then you have to manually add it to your M2 repo folder which is located at C:\Users\Mohit.Singh.m2\repository folder and then you have to run mvn eclipse:eclipse and then mvn clean install from the project folder if you do not have any wxternal or project sppecific dependency then you may import the project into eclipse as Existing maven project then right click on project --> GO to maven --> Click on update project a window will appear check the force snapshot download option and hit on OK

在我的例子中,我在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选择所有,然后单击卸载

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

尝试执行

mvn -U clean

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

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

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

我修改标签版本为:

<version>2.5.0</version>  

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