This recipe describes how to use the gmaven plugin (http://docs.codehaus.org/display/GMAVEN/Home) to run Groovy scripts.
The ability to run Groovy scripts in builds allows you to consistently use one scripting language in Maven and Jenkins. Groovy can be run in any Maven phase. Maven can execute the Groovy source code from within the build file, at another file location, or from a remote web server.
Maintainability of scripting
For later re-use, consider centralizing your Groovy code outside the build files.
Create the directory
</project>tag within your template file (mentioned in the introduction), ...