zoukankan      html  css  js  c++  java
  • was cached in the local repository, resolution will not be reattempted until the update interval of fintech has elapsed or updates are forced

    今天使用命令mvn compile编译maven项目时提示错误信息,错误信息如下: 

    [ERROR] Failed to execute goal on project <project_name>: Could not resolve dependencies
    for project com.xxx.xxx:<project_name>:jar:1.0.7: Failure to find com.xxx.xxx:obj-test-client:jar:1.1.1
    in http://maven-nexus.xxx.com/repository/maven-public/ was cached in the local repository, resolution 
    will not be reattempted until the update interval of fintech has elapsed or updates are forced -> [Help 1]

    问题原因 :
    Maven默认会使用本地缓存的库来编译工程,对于上次下载失败的库,maven会在~/.m2/repository/<group>/<artifact>/<version>/目录下创建xxx.lastUpdated文件,一旦这个文件存在,那么在直到下一次nexus更新之前都不会更新这个依赖库。

    解决办法:

    删除v~/.m2/repository/<group>/<artifact>/<version>/目录下的*.lastUpdated文件,然后再次运行mvn compile编译工程。

    Jenkins构建时报错:

    通过jenkins编译时报此错,我的maven安装目录/opt/maven ,解决方法如下:

    发现obj-test-client-1.1.1.jar下载到本地时失败,从提示可知是本地仓库的缓存(cached)造成,于是我删除目录/opt/maven/repo/<group>/obj-test-client/1.1.1后Jenkins重新构建(或在项目目录 mvn 重新编译)即可编译成功! 

    注意你要确定远程仓库中存在此jar(obj-test-client-1.1.1.jar)包 

  • 相关阅读:
    安卓数据存储(3):SQLite数据库存储
    安卓活动间的传值问题
    JavaScript、jQuery获取radio、checkbox选中的值
    无法连接到VSS资源数据库
    JQuery自定义搜索控件
    UIAlertView使用
    Xcode使用git管理版本
    达乐居视频网前台页面的总结
    Spark环境搭建遇到的问题
    在IE中启动火狐——自定义浏览器链接协议
  • 原文地址:https://www.cnblogs.com/Dev0ps/p/10607611.html
Copyright © 2011-2022 走看看