Pre-requisites :
Because our groupId isn't referenced by maven to be a plugin groupId (by default maven knows only org.apache.maven.plugins and org.codehaus.mojo) you have to add it in your user's settings (~/.m2/settings.xml) :
<settings>
...
<pluginGroups>
<pluginGroup>com.octo.mtg</pluginGroup>
</pluginGroups>
...
</settings>
To use the plugin you just have to launch :
mvn grails:<a goal>
To use a snapshot version of the plugin, in addition of the settings explained on top you also have to had in your settings a profile with our repositories to download the plugin and its dependencies.
<settings>
...
<profiles>
<profile>
<id>mtg</id>
<repositories>
<repository>
<id>mtg.snapshots</id>
<name>Forge Snapshot Repository</name>
<url>http://forge.octo.com/archiva/repository/mtg-snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>mtg.snapshots</id>
<name>Forge Snapshot Repository</name>
<url>http://forge.octo.com/archiva/repository/mtg-snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
...
</settings>
You can activate this profile permanently in your settings
<settings>
...
<activeProfiles>
<activeProfile>mtg</activeProfile>
</activeProfiles>
...
</settings>
Or just when necessary with the command line parameter
mvn -Pmtg <A goal|A phase>
To use the snapshot version of the plugin you can declare it in your project POM or you can use the long syntax to call the plugin :
mvn com.octo.mtg:grails-maven-plugin:<x.x>-SNAPSHOT:<A Goal>