Maven Release Plugin use in Jenkins Pipeline
<p>I'm using Jenkins Pipeline to automatically build and deploy my Java apps. I also use maven-release-plugin to perform Maven deploy to Artifactory.</p>

<p>The problem is my Jenkinsfile (or Jenkins Pipeline Configuration) : </p>

<ol>
<li>We commit a version 0.1.00-SNAPSHOT on release branch</li>
<li>Jenkins Pipeline get the code, and perform maven release</li>
<li>Maven Release changes the version to 0.1.00</li>
<li>Maven Release tags GIT branch, commit and deploy the artifact</li>
<li>Maven Release changes the version to 0.2.00-SNAPSHOT and commit</li>
<li>Jenkins Pipeline detect a change in GIT, so triggers a new build</li>
</ol>

<p>You understood that the last step creates an infinite loop, even if there is no useful commit.</p>

<p>Here is the interesting part of my Jenkinsfile :</p>

<pre><code>sshagent([git_credential]) {
    sh "${maven_bin} --settings ${maven_settings} -DreleaseVersion=${release_version} -DdevelopmentVersion=${development_version} release:prepare release:perform -B"
}
</code></pre>

<p>How can I break the loop (avoid Jenkins to trigger new build when Maven commits on GIT)?</p>

<p>Thanks</p>