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

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


当前回答

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

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

其他回答

如果你是一个代理,你必须更新settings.xml文件(在你的MAVEN_HOME的conf文件夹下,文件本身包含关于代理设置的信息),另外你可能需要更新你的Eclipse网络设置(窗口->Preferences…)—>类型Network Connections)。

尝试使用-X或——debug来获得调试输出,这可以提供关于问题的额外信息。

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

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

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

对于mac

我删除了所有旧的maven失败的下载,在我的mac上也有几个版本的maven

寻找~ /。M2 -name "*。lastUpdated" -exec grep -q " cannot transfer" {};-print -exec rm {};

之后,我简单地更新了我的eclipse

帮助->检查更新

这个问题为我解决了

这个问题的主要原因是失败的旧更新不允许你下载原型,所以如果你试图在maven的任何原型中构建项目,它会失败

对我来说。原因是一样的。我知道问题出在代理和防火墙上。

这是我的解决方案 第一种方法:1。安装代理Maven和Eclipse 2。执行“定位{user}/”。*. m2/repository,删除所有*.3.最后更新文件回到Eclipse,右键单击项目并选择Maven > Update project。>选择“快照/版本强制更新”。

如果项目仍然存在错误。例子:这里是我的问题之后所有以上步骤

Failure to transfer org.apache.maven:maven-archiver:pom:2.5 from https://repo.maven.apache.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:maven-archiver:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Connect timed out

我使用这个对我有用的解决方案: 1. 在https://mvnrepository.com/中查找存储库。将依赖项复制到我的*。Poml项目实例

<dependency>
    <groupId>org.apache.maven</groupId>
    <artifactId>maven-archiver</artifactId>
    <version>2.5</version>
</dependency>

3.构建项目。缺失的依赖项将被下载到本地存储库。 4. 回到Eclipse,右键单击项目并选择Maven > Update project。>选择“快照/版本强制更新”。=>>错误已解决在完成和解决后,我在第2步删除依赖项。 完成