码迷,mamicode.com
首页 > 系统相关 > 详细

maven+eclipse:Failure to transfer

时间:2015-07-24 12:19:30      阅读:298      评论:0      收藏:0      [点我收藏+]

标签:

配置好了maven环境,然后在eclipse中创建maven项目,添加依赖:

<dependency>
  <groupId>commons-logging</groupId>
  <artifactId>commons-logging</artifactId>
  <version>1.1.1</version>
 </dependency>

pom文件报错:

Failure to transfer commons-logging:commons-logging:jar:1.1.1 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 commons-logging:commons-logging:jar:1.1.1 from/
 to central (https://repo.maven.apache.org/maven2): The operation was cancelled. org.eclipse.aether.transfer.ArtifactTransferException: Failure to transfer commons-
 logging:commons-logging:jar:1.1.1 from https://repo.maven.apache.org/maven2.........

问度娘了半天,没找到解决办法,最后看到有个人说common包是maven类库里的基本包,一开始就下载下来的,我就去看了下,发现本地maven类库中确实已经有了common-logging目录,在其中找到1.1.1版本的目录,发现commons-logging-1.1.1.jar.lastUpdated,正常jar包后面有个.lastUpdated后缀,我从官网下了个commons-logging-1.1.1.jar,替换了commons-logging-1.1.1.jar.lastUpdated,然后在eclipse中,选中项目-右击-maven-update project,ok 报错消失。

以后再遇到类似问题,先查看本地类库中有没有.lastUpdated后缀文件,记录一下,以后可以提醒自己。

maven+eclipse:Failure to transfer

标签:

原文地址:http://www.cnblogs.com/xuyy/p/4672908.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!