title: Release Management - Maven, Bamboo and JIRA
body: <p>I'd like to find the best way to manage releases using Maven 2, Bamboo 3.1 and JIRA 4.3. I've tried many things but I keep hitting dead ends due to bugs or missing functionality.</p>
  
  <p>My end goal is to have versions come from JIRA, have Bamboo take those versions and build artefacts from them using Maven then deploy those artefacts to a repository (Nexus in our case).</p>
  
  <p>Here are the approaches I have tried:</p>
  
  <p>1) Use a place holder in all poms for project versions:</p>
  
  <p>Parent pom</p>
  
  <pre><code>&lt;project ...&gt;
    &lt;groupId&gt;group&lt;/groupId&gt;
    &lt;artifactId&gt;parent&lt;/artifactId&gt;
    &lt;version&gt;${ci.version}&lt;/version&gt;
    ...
    &lt;modules&gt;...&lt;/modules&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Child pom</p>
  
  <pre><code>&lt;project ...&gt;
    &lt;parent&gt;
      &lt;groupId&gt;group&lt;/groupId&gt;
      &lt;artifactId&gt;parent&lt;/artifactId&gt;
      &lt;version&gt;${ci.version}&lt;/version&gt;
    &lt;/parent&gt;
    &lt;artifactId&gt;child&lt;/artifactId&gt;
    ...
  &lt;/project&gt;
  </code></pre>
  
  <p>This builds if you start the build from the project root pom and specify <code>-Dci.version=&lt;my-version&gt;</code> on the command line. Combine this with the <a href="https://plugins.atlassian.com/plugin/details/28559" rel="noreferrer">Bamboo Release Management Plugin</a> and I can build and deploy versions of my modules and release as needed.</p>
  
  <p>The problem with this approach is that Maven does not replace place holder variables in poms when deploying or installing which means the poms in the repository have the <code>${ci.version}</code> marker when I'd really like them to have the concrete version. Because of the place holder it means nobody can use the modules I deploy. See <a href="http://jira.codehaus.org/browse/MNG-2971" rel="noreferrer">MNG-2971</a>.</p>
  
  <p>2) Use concrete SNAPSHOT versions in the pom and configure bamboo to execute the <a href="http://maven.apache.org/plugins/maven-release-plugin/" rel="noreferrer">Maven Release Plugin</a> using the Bamboo Release Management Plugin.</p>
  
  <p>Unfortunately the Maven Release Plugin needs the version to increment to, the bamboo plugin allow you to get the name of the current version to build but not the next one. Without this information using the Maven Release Plugin would increment the version to something that is not managed by JIRA. To make this option work I'd either need the next version available to me or be able to run a plan after the Bamboo Release Management Plugin has done it's thing (this second fix would also add extra mess to the commit logs as you'd get one commit for the auto increment and one for the proper increment).</p>
  
  <p>2.b) Same as 2) but you have to specify the next version in Bamboo before any release build through the plan configuration interface, setting the value manually to the next JIRA version the plan should be working on. This fixes the problem with 2) but adds extra manual steps.</p>
  
  <p>3) Do things manually, probably using the Maven Release Plugin. Completely ignore all release functionality in Bamboo and manually manage released on the command line by calling the Maven Release Plugin goal to change the version as and when needed. JIRA versions will also need to be released manually when this happens. We also need to configure a bamboo build to run and test the tag that the release plugin creates for the non-SNAPSHOT version.</p>
  
  <p>This option has so much process involved something is bound to go wrong.</p>
  
  <p>I can't be the only person trying to get automated releases using these technologies, can anyone help.</p>
  
  <p>Thanks</p>