title: Maven and git-flow, version strategy for release candidates
body: <p>We are trying to apply the git-flow model to maven projects.</p>
  
  <p>We use the <code>develop</code> and <code>feature/XXX</code> branches to work on <code>-SNAPSHOT</code> versioned artifacts, that are deployed in our <code>DEV</code> and <code>TST</code> environments.</p>
  
  <p>When the apps are "ready", we have "Release candidates" : the code is pushed on the <code>release</code> branch, we edit the pom to update the version (replace the <code>-SNAPSHOT</code> by <code>-RC1</code>), this version is built and stored in the repository manager, and then deployed on our <code>UAT</code> env. </p>
  
  <p>If some fixes are needed, we create others <code>-RCx</code> versions in the same <code>release</code> branch, these artifacts are archived in the repository manager, and deployed on the <code>UAT</code> env. So we can precisely track the bug fix in the different versions.</p>
  
  <p>Once a <code>-RCx</code> version is approved, the <code>release</code> branch is pushed to <code>master</code>, the pom updated to remove the <code>-RCx</code>, built, and stored in the repository manager before being deployed in <code>PROD</code> env.</p>
  
  <p>But with this way of doing things, the binaries that are deployed in <code>PROD</code> and in <code>UAT</code> are not strictly the same : the POMs are different in the 2 WARs, because of the <code>&lt;version&gt;</code> tag. <em>And it is not really a good practice.</em></p>
  
  <p>If I correctly understood the git-flow model, the "final" version number (without a <code>-RCx</code>) should be set at the creation of the <code>release</code> branch, and the same version is "alive" until this branch is pushed to the <code>master</code>, right ? In this case:</p>
  
  <ul>
  <li>We lose the information of what version of the application is really deployed in <code>UAT</code> (as we lost the <code>-RCx</code> identifier, we may not know if the deployed version contains the last bugfixes or if it is an older version that is deployed...)</li>
  <li>In the repository manager, we cannot know if an artifact has been built from the <code>release</code> branch or from the <code>master</code>, as there is no change of the version number anymore when pushing the <code>feature</code> branch into <code>master</code>.</li>
  </ul>
  
  <p>What is better ? What are the pros/cons of these 2 ways of doing ? (Not the same binaries on the different envs -vs- not having well-identified release candidates.)</p>
  
  <p>How do you (or would you) manage <em>Release Candidates</em> with a Maven project in the git-flow model ?</p>