I have maven inheritance setup for my project build. Project A is defined as parent on Project B and Project C. Inheritance on Project B pom.xml is as below
<parent>
<artifactId>Project A</artifactId>
<groupId>path to Project A</groupId>
<version>2</version>
<relativePath/>
</parent>
<build>
</build>
<dependencies>
<dependency>
<groupId>path to Project C</groupId>
<artifactId>Project C</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
Version of Project C; used as dependency on Project B is defined in Project A which is parent to both B and C and many of other builds.
Problem is when Project C and Project B are updated :-
- I build Project C first, which is a success.
- I build Project A, with updated version of project C, which also is success on node <Node 01> of Jenkins. Note, I cannot update the version of Project A ( this because there are other child pom those are also using verison 2).
- But on executing Project B, which gets executed on <Node 02> of JENKINS, it fails because it could not find updated version of Project C via Project A. If we point and run Project B on <Node 01> where Project A was built, Project B succeeds as well.
So the question is, is there a way to force the build for Project B to always pull the defined version of parent pom ;Project A, even if that version is already present on the Jenkins <Node 02> (from earlier or other build) and then run the project B specific build.
Thanks in advance