title: change version number dynamically when build with maven
body: <p>Instead of changing the version manually, is there any way to update it with the build number?</p>
  
  <pre><code> &lt;version&gt;1.2.132-SNAPSHOT&lt;/version&gt;
  </code></pre>
  
  <p>In the above code, I need the build number instead of 132. </p>
  
  <p>I've used the following code to generate the build number.</p>
  
  <pre><code>       &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
              &lt;artifactId&gt;buildnumber-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;1.0&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;format&gt;{0,number}.{1,number}.{2,number}&lt;/format&gt;
                  &lt;items&gt;
                      &lt;item&gt;buildNumber0&lt;/item&gt;
                      &lt;item&gt;buildNumber1&lt;/item&gt;
                      &lt;item&gt;buildNumber2&lt;/item&gt;
                  &lt;/items&gt;
              &lt;/configuration&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;phase&gt;initialize&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;create&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
  </code></pre>
  
  <p>And I need the build number just before -SNAPSHOT. Any ideas ? </p>