zoukankan      html  css  js  c++  java
  • maven+eclipse:Failure to transfer

    配置好了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后缀文件,记录一下,以后可以提醒自己。

  • 相关阅读:
    496. 下一个更大元素 I 力扣(简单) 单调栈
    240. 搜索二维矩阵 II 力扣(中等) Z字型查找
    638. 大礼包 力扣(中等) 记忆化搜索,弱点
    453. 最小操作次数使数组元素相等 力扣(简单) 没想出来
    传纸条
    同余方程
    花匠
    华容道
    货车运输
    火柴排队
  • 原文地址:https://www.cnblogs.com/xuyy/p/4672908.html
Copyright © 2011-2022 走看看