gpt4 book ai didi

java - Maven 错误 - 传输失败

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:47:01 25 4
gpt4 key购买 nike

我正在网上查看一些 spring 示例。我从

得到了一个例子

http://code.google.com/p/spring-finance-manager/

在我的 eclipse 中导入项目时,我在 POM.xml 文件中出错。

Multiple annotations found at this line:
- Failure to transfer org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from http://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.plugins:maven-resources-plugin:pom:2.5 from/to central (http://repo.maven.apache.org/maven2): null to http://
repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom
- connection timed out
- Failure to transfer org.apache.maven.plugins:maven-source-plugin:pom:2.0.4 from http://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.plugins:maven-source-plugin:pom:2.0.4 from/to central (http://repo.maven.apache.org/maven2): connection timed out to
http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-source-plugin/2.0.4/maven-source-plugin-2.0.4.pom

我还尝试删除我的 .m2\repository 文件夹。但仍然出现错误。

谁能指导我解决这个问题?

最佳答案

是的,我自己也遇到过这个问题。以下是一些其他观察结果:

  1. 以前,当我遇到此错误时,我会转至 Maven -> 更新 Maven 项目,如果这不起作用,则转至 Maven -> 更新 Maven 项目和“强制更新快照/发布”。这种技术会奏效。
  2. 一段时间后,上面的 #1 停止工作。但是,当我在没有代理的情况下在同一个工作区中构建同一个项目时,它起作用了。
  3. 应用带有代理信息的 settings.xml 并不能解决下面所述的这个特定问题:

Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (http://repo.maven.apache.org/maven2): connect timed out

我也想知道这到底意味着什么:究竟是什么在转移,从哪里转移到哪里?我相信我们最初在工作区中有 .pom 文件,并且基于 pom,必要的 Artifact 将下载到我们的本地 maven 存储库。我们的 IDE 构建路径中进一步引用了这些存储库。

为什么它对某些 Artifact “超时”而不对其他 Artifact “超时”?此外,这些东西似乎指向“org.eclipse.m2.core”。更准确地说,org.eclipse.m2.core 和代理的组合正在搞砸它——作为开发人员,我们无法控制。这是非常令人沮丧的。

我们不知道的事情会严重伤害我们 - 例如 - (eclipse + proxy)动态。

关于java - Maven 错误 - 传输失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23490556/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com