<p>I have a multi-module maven project in Kubernates. We intend to version all these modules together. But as of now, I end up hard-coding version in each of the module pom.xml as below</p>

<pre><code>&lt;parent&gt;
    &lt;artifactId&gt;xyz-application&lt;/artifactId&gt;
    &lt;groupId&gt;com.xyz&lt;/groupId&gt;
    &lt;version&gt;2.50.0.g&lt;/version&gt;
&lt;/parent&gt;
&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
&lt;groupId&gt;com.xyz&lt;/groupId&gt;
&lt;artifactId&gt;xyz-Library&lt;/artifactId&gt;
&lt;version&gt;2.50.0.g&lt;/version&gt;
</code></pre>

<p>The main parent module has the below configuration</p>

<pre><code>&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
&lt;groupId&gt;com.xyz&lt;/groupId&gt;
&lt;artifactId&gt;xyz-application&lt;/artifactId&gt;
&lt;version&gt;2.50.0.g&lt;/version&gt;
&lt;packaging&gt;pom&lt;/packaging&gt;
</code></pre>

<p><a href="https://stackoverflow.com/questions/5726291/updating-version-numbers-of-modules-in-a-multi-module-maven-project">Reference</a></p>

<p>Currently, I'm using the mvn release plugin in the pom.xml</p>

<pre><code>&lt;plugin&gt;
    &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
    &lt;artifactId&gt;maven-release-plugin&lt;/artifactId&gt;
    &lt;version&gt;2.5.3&lt;/version&gt;
    &lt;configuration&gt;
        &lt;autoVersionSubmodules&gt;true&lt;/autoVersionSubmodules&gt;
        &lt;tagNameFormat&gt;${product_label}-@{project.version}&lt;/tagNameFormat&gt;
        &lt;releaseProfiles&gt;releases&lt;/releaseProfiles&gt;
        &lt;preparationGoals&gt;clean deploy&lt;/preparationGoals&gt;
        &lt;arguments&gt;-s settings.xml&lt;/arguments&gt; 
    &lt;/configuration&gt;
&lt;/plugin&gt;
</code></pre>

<p>Since the project is in Kubernetes, here is the Jenkins file content I'm using while the release</p>

<pre><code>def MVN_RELEASE = "release:clean release:prepare release:perform -Dmaven.source.skip=true"
stage('Release artifacts to artifactory') {
    steps {
        container('maven') {
            withCredentials() {
                sh "mvn ${MVN_RELEASE}  -Dresume=false"
            }
        }
    }
}
</code></pre>

<p>Now, during release, I need to update the parent pom and all sub-modules poms version by a new version of my choice, I can use a <a href="http://www.mojohaus.org/versions-maven-plugin/" rel="nofollow noreferrer">mvn version plugin</a>, something like</p>

<ol>
<li><code>mvn versions:set -DnewVersion=3.00.0-SNAPSHOT -DprocessAllModules -DgenerateBackupPoms=false</code> and then</li>
<li><code>mvn versions:commit -DprocessAllModules</code></li>
</ol>

<p>At what stage in Jenkins/pom.xml should I add this? Now, this plugin is useful only when I want to bump to a specific version of my choice (like <code>3.00.0-Snapshot</code>), otherwise, the mvn release plugin should bump the version automatically to something like <code>2.50.1-SNAPSHOT</code>. Is that correct understanding? </p>

<p>How can I gracefully handle this pom version update issue?</p>

<p>Thanks in advance!</p>

<p>I do not see why you want the version plugin.</p>

<p>First of all, you don't need to add the <code>&lt;version&gt;</code> tag to the modules. You need to specify the version of the parent, but you can inherit your version (which is the same) from the parent.</p>

<p>Secondly, the maven release plugin has parameters <code>releaseVersion</code> and <code>developmentVersion</code> which allow you to set a release and future development version on the command line.</p>
