Could not resolve dependencies for project

在将Jenkins服务迁移到新服务器后,遇到项目构建失败的问题,原因是Maven无法解析某些依赖。错误信息显示未能找到特定版本的项目依赖项。解决方法是将旧Jenkins服务器上Maven的settings.xml文件复制到新服务器的相应位置,以确保新Jenkins实例能够正确配置依赖路径。
摘要由CSDN通过智能技术生成

Jenkins服务 迁移到新机器后,项目无法完成下载,报错:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.097 s
[INFO] Finished at: 2018-01-22T16:54:28+08:00
[INFO] Final Memory: 10M/103M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data[ERROR] Failed to execute goal on project test-api: Could not resolve dependencies for project net.protest:test-api:war:1.0.4-SERVER: The following artifacts could not be resolved: net.protest:test-commons:jar:1.1.0-SERVER, net.protest:test-service:jar:1.0.4-SERVER: Could not find artifact net.protest:test-commons:jar:1.1.0-SERVER -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

[JENKINS] Archiving /home/jenkins/.jenkins/workspace/api_build_api0-2/pom.xml to net.protest/test-api/1.0.4-SERVER/test-api-1.0.4-SERVER.pom
channel stopped
Finished: FAILURE

解决方法:

将旧jenkins服务器上maven安装目录下settings.xml文件导入新的jenkins服务器中:

旧jenkins服务器文件位置:~/.m2/settings.xml 新服务器位置如下,将settings.xml文件替换:

# find / -name settings.xml
    /usr/maven/conf/settings.xml       
# ln -s /usr/maven/conf/settings.xml /home/jenkins/.m2/settings.xml
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值