title: Why Maven Versions Plugin (versions:use-latest-versions) not updating/changing -SNAPSHOT version to release (none -SNAPSHOT version)?
body: <p>I am using the <a href="http://www.mojohaus.org/versions-maven-plugin/" rel="noreferrer">Version Maven Plugin</a> plugin <a href="http://www.mojohaus.org/versions-maven-plugin/use-latest-versions-mojo.html" rel="noreferrer">use-latest-versions</a> functionality to update groupID=com.example* internal dependency versions to the latest version. This is executed as part of our CI system using Jenkins.</p>
  
  <p>When developers start working on a new feature they branch the code, work on the branch and when the new feature is implemented (or partially implemented) the code is merged back to trunk (usually multiple times a week).</p>
  
  <p><strong>Branches version update:</strong></p>
  
  <ul>
  <li>Using "snapshot" profile. See below pom.xml snapshot profile configuration and Artifactory repo configuration</li>
  <li>Command used to update version: <code>mvn -P snapshot -B versions:use-latest-versions versions:update-properties -Dincludes=com.example* -DexcludeReactor=false -DallowSnapshots=true ...</code></li>
  </ul>
  
  <p><strong>Trunk version update:</strong></p>
  
  <ul>
  <li>Using "production" profile. See below pom.xml production profile configuration and Artifactory configuration</li>
  <li>Command used to update version: <code>mvn -P production -B versions:use-latest-versions versions:update-properties -Dincludes=com.example* -DexcludeReactor=false ...</code></li>
  </ul>
  
  <p>Sometimes branch builds update com.example* dependency versions to "...-SNAPSHOT" version (this is normal because libs-snapshot Artifactory repo is used as the dependency repository which can have -SNAPSHOT dependency versions). These version updates are checked back to source control (svn).</p>
  
  <p>When the code (including the pom.xml version update changes) are merged back from branches to trunk and the trunk build is executed, all com.example* internal dependency versions should be changed/updated to the latest release versions. But because of some reason when dependency versions have "-SNAPSHOT" in it <strong>versions:use-latest-versions</strong> is not changing/updating the version to the latest release (none -SNAPSHOT) version.</p>
  
  <hr>
  
  <p><strong>Example:</strong></p>
  
  <p>Artifactory repos have the flowing versions:</p>
  
  <ul>
  <li>libs-snapshot has "com.example:myLib:1.1.10-SNAPSHOT", "com.example:myLib:1.1.11-SNAPSHOT"</li>
  <li>libs-release has "com.example:myLib:1.1.9", "com.example:myLib:1.1.12"</li>
  </ul>
  
  <p>Making myApp branches build will get dependency versions from libs-snapshot and update com.example:myLib version to 1.1.11-SNAPSHOT and check this update back to SVN</p>
  
  <pre><code>...    
      &lt;dependency&gt;
          &lt;groupId&gt;com.example&lt;/groupId&gt;
          &lt;artifactId&gt;myLib&lt;/artifactId&gt;
          &lt;version&gt;1.1.11-SNAPSHOT&lt;/version&gt;
      &lt;/dependency&gt;
  ...
  </code></pre>
  
  <p>Merging code back to trunk including the above dependency version changes and running the trunk build (including version update) <code>mvn -P production -B versions:use-latest-versions...</code> does not change the com.example:myLib version to 1.1.12</p>
  
  <hr>
  
  <p><strong>Artifactory configuration:</strong></p>
  
  <ul>
  <li>Local repos: libs-snapshot-local (development repository); libs-release-local (release repository)</li>
  <li>Virtual repos: libs-snapshot (includes libs-snapshot-local, libs-release-local and remote-repos);  libs-release (includes libs-release-local and remote repos)</li>
  </ul>
  
  <hr>
  
  <p><strong>pom.xml configuration:</strong></p>
  
  <pre><code>...
  &lt;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;snapshot&lt;/id&gt;
          &lt;distributionManagement&gt;
              &lt;repository&gt;
                  &lt;id&gt;libs-snapshot-local&lt;/id&gt;
                  &lt;name&gt;Internal Applications Snapshot Repository&lt;/name&gt;
                  &lt;url&gt;http://example.com/artifactory/libs-snapshot-local&lt;/url&gt;
              &lt;/repository&gt;
          &lt;/distributionManagement&gt;
  
          &lt;repositories&gt;
              &lt;repository&gt;
                  &lt;snapshots&gt;
                      &lt;enabled&gt;true&lt;/enabled&gt;
                      &lt;updatePolicy&gt;always&lt;/updatePolicy&gt;
                  &lt;/snapshots&gt;
                  &lt;id&gt;libs-snapshot&lt;/id&gt;
                  &lt;name&gt;libs-snapshot&lt;/name&gt;
                  &lt;url&gt;http://example.com/artifactory/libs-snapshot&lt;/url&gt;
                  &lt;releases&gt;
                      &lt;enabled&gt;true&lt;/enabled&gt;
                      &lt;updatePolicy&gt;always&lt;/updatePolicy&gt;
                  &lt;/releases&gt;
              &lt;/repository&gt;
              &lt;repository&gt;
                  &lt;snapshots&gt;
                      &lt;enabled&gt;false&lt;/enabled&gt;
                  &lt;/snapshots&gt;
                  &lt;id&gt;libs-release&lt;/id&gt;
                  &lt;name&gt;libs-release&lt;/name&gt;
                  &lt;url&gt;http://example.com/artifactory/libs-release&lt;/url&gt;
                  &lt;releases&gt;
                      &lt;enabled&gt;true&lt;/enabled&gt;
                      &lt;updatePolicy&gt;always&lt;/updatePolicy&gt;
                  &lt;/releases&gt;
              &lt;/repository&gt;
          &lt;/repositories&gt;
  
          &lt;build&gt;
              ...
          &lt;/build&gt;
      &lt;/profile&gt;
  
      &lt;profile&gt;
          &lt;id&gt;production&lt;/id&gt;
  
          &lt;distributionManagement&gt;
              &lt;repository&gt;
                  &lt;id&gt;libs-release-local&lt;/id&gt;
                  &lt;name&gt;Internal Applications Snapshot Repository&lt;/name&gt;
                  &lt;!-- Artifacts are promoted to libs-release-local not deployed directly --&gt;
                  &lt;url&gt;http://example.com/artifactory/libs-snapshot-local&lt;/url&gt;
              &lt;/repository&gt;
          &lt;/distributionManagement&gt;
  
          &lt;repositories&gt;
              &lt;repository&gt;
                  &lt;snapshots&gt;
                      &lt;enabled&gt;false&lt;/enabled&gt;
                  &lt;/snapshots&gt;
                  &lt;id&gt;libs-release&lt;/id&gt;
                  &lt;name&gt;libs-release&lt;/name&gt;
                  &lt;url&gt;http://example.com/artifactory/libs-release&lt;/url&gt;
                  &lt;releases&gt;
                      &lt;enabled&gt;true&lt;/enabled&gt;
                      &lt;updatePolicy&gt;always&lt;/updatePolicy&gt;
                  &lt;/releases&gt;
              &lt;/repository&gt;
          &lt;/repositories&gt;
  
          &lt;build&gt;
              ...
          &lt;/build&gt;
      &lt;/profile&gt;
  
  &lt;/profiles&gt;
  </code></pre>
  
  <p>...</p>