I have two Bamboo plans, the first one produces a shared artifact (a library) and the second one attempts to download it. The first plan puts the build number into the artifact name, the copy pattern is defined this way:
release-x64-b${bamboo.buildNumber}-runtime.zip
So I get a number of artifacts in the plan directory:
release-x64-b671-runtime.zip
....
release-x64-b678-runtime.zip
The dependent plan is instructed to simply download the artifact. I think it's using the copy pattern from the parent plan because I'm running into an issue where the dependent plan is substituting its own build number when downloading the artifact, here's a log excerpt:
Preparing to download plan result PROJECT-WVN-678 artifact: Shared artifact: [x64 Nightly Runtime], pattern: [release-x64-b207-runtime.zip]
(The dependent build number is 207 while the parent build number is 678). Is there a way for me to work around this 'feature'?
I hope if you have a dependent plan, then it is a subsequent stage. So, in the parent build you can save the build number in mvn_version using powershell script.
Then put the value into a text file
Then add a task, inject bamboo variables, where you can set the path of file ./mvn_version.txt and namespace as inject. Choose the radio button as result, so the value will be subsequently accessible in following stages/dependent plans and release plan also.