If you are trying to build a development version of a maven plugin, or you just need to trial the latest plugin code that is yet to be released, then you may need to access the maven plugin snapshot repositories.
The most widely known repositories are Maven itself hosted at Apache and the Mojo Project hosted at CodeHaus.
Both of these sites provide snapshot versions of their plugins which are available from the plugin snapshot repository.
You need to modify your ~/.m2/settings.xml file to include two new profiles and then when you need access to the plugin snapshots use -Papache or -Pcodehaus to enable the profiles. The profile only needs to be enabled once so that the plugins can be downloaded into you local repository. Once in your local repository Maven can succesfully resolve the dependencies and the profile no longer needs to be activated.
<settings>
...
<profiles>
<profile>
<id>apache</id>
<repositories>
<repository>
<id>apache.org</id>
<name>Maven Snapshots</name>
<url>http://people.apache.org/repo/m2-snapshot-repository</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>apache.org</id>
<name>Maven Plugin Snapshots</name>
<url>http://people.apache.org/repo/m2-snapshot-repository</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<profile>
<id>codehaus</id>
<repositories>
<repository>
<id>codehaus.org</id>
<name>CodeHaus Snapshots</name>
<url>http://snapshots.repository.codehaus.org</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>codehaus.org</id>
<name>CodeHaus Plugin Snapshots</name>
<url>http://snapshots.repository.codehaus.org</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
...
</settings>
When invoking Maven for Apache profile, do it like this:
mvn -Papache <phase|goal>