title: How to lock maven plugin version
body: <p>How can I lock the version of a Maven plugin I want to use?</p>
  
  <p>I have the PMD plugin configured like so:</p>
  
  <pre><code>&lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-pmd-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.5&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;outputDirectory&gt;target/pmd&lt;/outputDirectory&gt;
                      &lt;targetDirectory&gt;target/&lt;/targetDirectory&gt;
                      &lt;aggregate&gt;true&lt;/aggregate&gt;
                      &lt;targetJdk&gt;1.6&lt;/targetJdk&gt;
                      &lt;rulesets&gt;
                          &lt;ruleset&gt;rulesets/basic.xml&lt;/ruleset&gt;
                          &lt;ruleset&gt;rulesets/codesize.xml&lt;/ruleset&gt;
                          &lt;ruleset&gt;rulesets/coupling.xml&lt;/ruleset&gt;
                          &lt;ruleset&gt;rulesets/design.xml&lt;/ruleset&gt;
                          &lt;ruleset&gt;rulesets/imports.xml&lt;/ruleset&gt;
                          &lt;ruleset&gt;rulesets/logging-java.xml&lt;/ruleset&gt;
                          &lt;ruleset&gt;rulesets/optimizations.xml&lt;/ruleset&gt;
                          &lt;ruleset&gt;rulesets/strings.xml&lt;/ruleset&gt;
                          &lt;ruleset&gt;rulesets/unusedcode.xml&lt;/ruleset&gt;
                      &lt;/rulesets&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  </code></pre>
  
  <p>Last night, my nightly build failed and I can no longer run any pmd goals because it is trying to find version 2.6-SNAPSHOT of that plugin.  Why is it even trying to find 2.6-SNAPSHOT if I have a version tag that says 2.5?  Also, 2.6-SNAPSHOT is not in central - why does my maven client think it exists?</p>
  
  <p>Maven version: 2.0.9<br>
  Java version: 1.6.0_17<br>
  OS name: "linux" version: "2.6.24-24-generic" arch: "i386" Family: "unix"</p>
  
  <p>Edit:</p>
  
  <p>I upgraded to maven 2.2.1 and observed the same issue as before.  I was able to get the project to build by removing 2.6-SNAPSHOT from the metadata in my repository (.m2/repository/org/apache/maven/plugins/maven-pmd-plugin/maven-metadata-central.xml).  I also set the latestVersion tag to 2.5.  This is obviously not the solution, because I'd have to either deploy my own plugin or change the cached version on all clients.  </p>