Best practices for handling maven -SNAPSHOT artifact deployment in Bamboo with automatic branch detection?

Using Bamboo 4.1, we have a number of common artifacts building and deploying to our local maven repository server for use in dependent plans; eg. java-common and java-core plans produce java-common-SNAPSHOT and java-core-SNAPSHOT artifacts, for use in java-planA and java-planB.

However, when ABD is enabled against a central Git remote, the branch (say java-common-featurebranch) deploys the -SNAPSHOT again, resulting in a potentially incompatible -SNAPSHOT jar dropping to maven, and leading to downstream build issues.

Obviously, this _could_ be handled by enforcing policies in which branches are required to update the POM to reflect a different artifact handle, or by ensuring that downstream builds rely on non-SNAPSHOT artifacts, but both of these solutions seem creaky.

How does Atlassian, or any other group that sees this question handle situations like this? I figured I'd ask before filing an improvement request in JAC, since it seems like this can't be an uncommon situation, and someone may have a clever solution.

Ideas I've tossed around:

  • Policy enforcement
  • Tasks to rewrite the POM on the fly
  • Manual execution of mvn deploy stages
  • Enhancement request :)

Anyone have better solutions? It seems like there's a couple open BAM issues that might start to lead to a solution, including BAM-10804, but there's still some definite magic that would have to occur inside Bamboo's mvn plugins to improve this.

1 answer

1 accepted

How about specifying a different version for your maven project based on the branch name? With 4.2, we added the bamboo.branchName variable so passing the following to the Maven via the Goals field on the Maven task should work


You guys always seem to have a release that solves a need shortly after I find the need. Cheers!

Glad to hear it! Hope this works out for you.

Suggest an answer

Log in or Join to answer
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,204 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot