title: Updating versions in multi-module Maven project
body: <p>I am trying to release our multi-module Maven project and I can't figure out how to properly update the version numbers in our POMs.</p>
  
  <p>The maven release plugin doesn't update versions in the parent POM dependencyManagement section - that seems to be a known bug.</p>
  
  <p>I tried to use the versions plugin, but I have two issues with that:</p>
  
  <ul>
  <li>the plugin only updates my toplevel POM; probably because the multi-module project POM is <em>not</em> the paremt POM of the modules's POMs</li>
  <li>more significantly, how can I mimic the behavior of the release plugin to automatically compute the versions to set (e.g. 1.0.0) from the current version in the POMs (e.g. 1.0.0-SNAPSHOT)... without giong into perl scripting?</li>
  </ul>
  
  <p>Any suggestion that doesn't involve scripting, and doesn't require me to declare dependency versions outside of dependencyManagement would be very appreciated!</p>
  
  <p>Here are the 4 POMs (module POMs in their module subdirectory):</p>
  
  <pre><code>============ pom-parent.xml ==================
  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.acme&lt;/groupId&gt;
      &lt;artifactId&gt;dummy-parent&lt;/artifactId&gt;
      &lt;version&gt;2.5&lt;/version&gt;
  
      &lt;packaging&gt;pom&lt;/packaging&gt;
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;com.acme&lt;/groupId&gt;
                  &lt;artifactId&gt;module1&lt;/artifactId&gt;
                  &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>============= multi-module pom: pom.xml ================</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;parent&gt;
          &lt;groupId&gt;com.acme&lt;/groupId&gt;
          &lt;artifactId&gt;dummy-parent&lt;/artifactId&gt;
          &lt;relativePath&gt;pom-parent.xml&lt;/relativePath&gt;
          &lt;version&gt;2.5&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;groupId&gt;com.acme&lt;/groupId&gt;
      &lt;artifactId&gt;multi-module&lt;/artifactId&gt;
      &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
  
      &lt;packaging&gt;pom&lt;/packaging&gt;
  
      &lt;modules&gt;
          &lt;module&gt;module1&lt;/module&gt;
          &lt;module&gt;module2&lt;/module&gt;
      &lt;/modules&gt;
      &lt;scm&gt;
             &lt;developerConnection&gt;scm:svn:https://svnserver.fairisaac.com:8443/nowhere&lt;/developerConnection&gt;
         &lt;/scm&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>============== module1 POM: module1/pom.xml ================</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;parent&gt;
          &lt;groupId&gt;com.acme&lt;/groupId&gt;
          &lt;artifactId&gt;dummy-parent&lt;/artifactId&gt;
          &lt;relativePath&gt;../pom-parent.xml&lt;/relativePath&gt;
          &lt;version&gt;2.5&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;groupId&gt;com.acme&lt;/groupId&gt;
      &lt;artifactId&gt;module1&lt;/artifactId&gt;
      &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
  
      &lt;packaging&gt;jar&lt;/packaging&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>============= Module 2 POM: module2/pom.xml =============</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;parent&gt;
          &lt;groupId&gt;com.acme&lt;/groupId&gt;
          &lt;artifactId&gt;dummy-parent&lt;/artifactId&gt;
          &lt;relativePath&gt;../pom-parent.xml&lt;/relativePath&gt;
          &lt;version&gt;2.5&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;groupId&gt;com.acme&lt;/groupId&gt;
      &lt;artifactId&gt;module2&lt;/artifactId&gt;
      &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
  
      &lt;packaging&gt;jar&lt;/packaging&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.acme&lt;/groupId&gt;
              &lt;artifactId&gt;module1&lt;/artifactId&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>========= Edit ==============</p>
  
  <p>... and it gets better, if I replace the explicit version in the dependencyManagement section with</p>
  
  <pre><code>&lt;version&gt;${project.version}&lt;/version&gt;
  </code></pre>
  
  <p>... maven 3.0.4 fails with an NPE:</p>
  
  <pre><code>[INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 4.478s
  [INFO] Finished at: Fri Apr 12 12:09:08 CEST 2013
  [INFO] Final Memory: 9M/120M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.0:prepare (default-cli) on project multi-
  module: Execution default-cli of goal org.apache.maven.plugins:maven-release-plugin:2.0:prepare failed. NullPointerExcep
  tion -&gt; [Help 1]
  </code></pre>