title: Maven artifact version number with custom variable
body: <p>I have in my pom this section:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;groupId&gt;com.sample.app&lt;/groupId&gt;
  &lt;artifactId&gt;simpleapp&lt;/artifactId&gt;
  &lt;version&gt;1.0.9-${buildNumber}-SNAPSHOT&lt;/version&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  </code></pre>
  
  <p>Is there any nice and "maven way" to keep this variable name ${buildNumber} in that place in pom as this is now?
  I mean - when I am performing </p>
  
  <pre><code>mvn deploy:prepare deploy:release  -DbuildNumber=${BUILD_NUMBER}
  </code></pre>
  
  <p>this version section in pom.xml is updated to (when BUILD_NUMBER eq: 12):</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;version&gt;1.0.9-12-SNAPSHOT&lt;/version&gt;
  </code></pre>
  
  <p>which almost is ok but this is also commited to repository. I like the fact that this tag: 1.0.9-12 in git repo is created, but I prefer to keep my original format of version in <code>pom.xml</code> file:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;version&gt;1.0.9-${buildNumber}-SNAPSHOT&lt;/version&gt;
  </code></pre>
  
  <p>This is because this stupid approach I have in my company to add to artefact version also build number from CI tool :(</p>
  
  <p>Can someone give me some hint how to handle this?</p>