-
Bug
-
Resolution: Not A Defect
-
Major
-
None
-
1.527
I have build a simplified PoC setup that I can use to describe and easily reproduce this issue:
I have two projects: parent and child. Both are set to version "0.0.1-SNAPSHOT" in their respective POMs. The parent project has a single dependency, child (with version 0.0.1-SNAPSHOT) and child has no dependencies. I set up two Jenkins Maven builds (called "parent" and "child") and didn't set any special options, other than how to check out the code. Note that I intentionally left the default setting "Build whenever a SNAPSHOT dependency is built" on.
So far so good. When "child" builds, "parent" is automatically kicked off.
Here's the problem: The downstream build (parent) picks up the wrong upstream build of child. After Jenkins boots, a build of "parent" will pick up the correct build, but after that, whatever that first build was, it is "stuck" with until Jenkins restarts.
So for example:
1) Build child, which produces build #2
2) This kicks off parent which will pick up the build from child #2 (good)
3) Build child again, which produced build #3
4) This again kicks off parent. But this time, Jenkins will report: "Started by upstream project child1 build number 3" (correct). But under "Upstream Builds", Jenkins reports "child1 - #2"
Anything in the downstream build (parent) that depends on an artifact from a specific upstream build (child) will be wrong.
(The logs also say that it was kicked off by the correct build (#3) but in a more complicated setup where it actually depends on artifacts from a specific build, it takes the artifacts from the wrong build, #2 in this example)