O'Reilly logo

Jenkins Continuous Integration Cookbook by Alan Berg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Running Groovy scripts through Maven

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.

Tip

Maintainability of scripting

For later re-use, consider centralizing your Groovy code outside the build files.

Getting ready

Create the directory ch3.building_software/running_groovy.

How to do it...

  1. Add the following fragment just before the</project> tag within your template file (mentioned in the introduction), ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required