首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Maven错误-传输失败

Maven错误-传输失败
EN

Stack Overflow用户
提问于 2014-05-06 17:14:58
回答 6查看 31.5K关注 0票数 4

我在网上研究了一些spring的例子。我举了一个例子

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

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

代码语言:javascript
运行
复制
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文件夹。但是仍然得到了错误。

有人能指导我解决这个问题吗?

EN

回答 6

Stack Overflow用户

发布于 2015-01-08 00:18:15

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

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

无法从中心(http://repo.maven.apache.org/maven2)向中心(http://repo.maven.apache.org/maven2)传输项目org.apache.maven.plugins:maven-resources-plugin:pom:2.6 :连接超时

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

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

我们不知道的东西可能会严重伤害我们--例如-- (eclipse +代理)动态。

票数 3
EN

Stack Overflow用户

发布于 2015-01-08 08:40:10

经过大量的谷歌搜索后,我找到了解决方案:除了在settings.xml中添加代理信息之外,我还必须添加以下内容来解决这个问题。同样,只有当涉及到代理时,这才是一个问题。这是下一次与eclipse相关的神秘堆栈跟踪呕吐之前的平静--我猜。

代码语言:javascript
运行
复制
  <activeProfiles>
    <activeProfile>securecentral</activeProfile>
  </activeProfiles>

  <profiles>
    <profile>
      <id>securecentral</id>
      <repositories>
        <repository>
          <id>central</id>
          <url>https://repo1.maven.org/maven2</url>
          <releases>
            <enabled>true</enabled>
          </releases>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>https://repo1.maven.org/maven2</url>
          <releases>
            <enabled>true</enabled>
          </releases>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>
票数 3
EN

Stack Overflow用户

发布于 2014-05-06 17:21:02

请求http://repo.maven.apache.org/maven2存储库时出现超时异常。http://repo.maven.apache.org/maven2不能正常工作的时间。也可能出现其他网络问题,如主机dns、网络中断集线器、网络代理设置等。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23490556

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档