简体   繁体   English

Jenkins一个maven项目依赖于另一个正在运行的问题

[英]Jenkins One maven project dependent on another Running Issue

I am trying to schedule job on jenkins which is dependent on another Maven project, I tried everything pipeline, multiphase phase project, but I am getting below issue repetitively; 我正在尝试在詹金斯上安排工作,该项目依赖于另一个Maven项目,我尝试了所有管道,多阶段项目,但是我反复遇到了这个问题;

Issue 问题

Could not resolve dependencies for project com.ctl.it.qa:Project-1:jar:1.0.0-SNAPSHOT: Failure to find com.ctl.it.qa:Projects-2:jar:1.1.1 in 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 -> [Help 1] 无法解析项目com.ctl.it.qa:Project-1:jar:1.0.0-SNAPSHOT的依赖项:无法在https:/中找到com.ctl.it.qa:Projects-2:jar:1.1.1 /repo.maven.apache.org/maven2已缓存在本地存储库中,直到中心的更新间隔过去或强制执行更新后,才会重新尝试解析-> [帮助1]

The above error is not expected because I have already have maven project called "Projects-2". 由于我已经有一个名为“ Projects-2”的Maven项目,因此不会出现上述错误。 It should pickup dependency from here. 它应该从这里开始依赖。

Nee to know what I am missing. 知道我所缺少的。

Will Appreciate for complete Solution. 将赞赏完整的解决方案。

Looking at the query, Jenkins should trigger in the below order 查看查询,詹金斯应按以下顺序触发
Project 1 -> Should be triggered first -> Creates Jar 项目1- >应该先触发->创建Jar
(After Successful generation of jar) (成功生成jar之后)
Project 2 -> Trigger project2 项目2- >触发project2

Before automating it , try manually triggering the projects. 在自动化之前,请尝试手动触发项目。
If you still get the current error, try Force update, so add -U along with the current goals. 如果仍然出现当前错误,请尝试强制更新,因此将-U与当前目标一起添加。

mvn clean install -U

And for effectively trigger a build based on a dependent build, you could try the https://wiki.jenkins.io/display/JENKINS/Parameterized+Trigger+Plugin 为了有效地触发基于依赖构建的构建,您可以尝试https://wiki.jenkins.io/display/JENKINS/Parameterized+Trigger+Plugin

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM