Notice: This resource is no longer being actively maintained and as a result some information may be out of date or inaccurate. Please see for technical instructions or for support related concerns.
DEV@cloud » Continuous Integration with Grails and Jenkins

Continuous Integration with Grails and Jenkins

Last modified by Cyrille Le Clerc on 2013/04/26 15:34

How to create a Grails build with Jenkins and Grails Wrapper

error Using the Grails Wrapper to build a project is significantly slower than using a pre-installed Grails SDK as described in the "How to declare a Grails SDK in Jenkins" chapter.

Details on Grails Wrapper are available at The Grails Framework - Reference Documentation - Grails Wrapper.

1. Click on Builds


2. Click on Manage Jenkins


3. Click on Manage Plugins


4. Ensure that the Grails plugin is enabled




5. Create a Free Style Job


6. Add a "Build With Grails" step using Grail Wrapper



error Warning, using the "Grail Wrapper" to build the application requires the prior installation of this Wrapper (see Grails Documentation > The Wrapper). 

8. Add a post build action "Deploy Application" 


Try with CloudBees Grail PetClinic ClickStart!

This ClickStart will 

  1. Create a git repository on CloudBees Forge forking a GitHub version of Grails PetClinic,
  2. Create the Jenkins to build the project which will automatically deploy successful builds on a server,
  3. Create a MySQL database,
  4. Deploy the Grails PetClinic application on a CloudBees Tomcat container associated with the database,

Press the button to build, test and deploy this instantly:

How to declare a Grails SDK in Jenkins

If you don't use the Grails Wapper, you will need to declare a Grails SDK in your Jenkins configuration.

1. Click on "Manage Jenkins"


2. Click on "Configure System"


3. Scroll down to Grails and click on "Grails installations..."


4. Declare the Grails SDK with the needed version



My build fails with  a IOException: Cannot run program "grails"

[grails-petclinic-clickstart] $ grails clean --non-interactive
FATAL: command execution failed Cannot run program "grails" (in directory "/scratch/jenkins/workspace/grails-petclinic-clickstart"): error=2, No such file or directory
 at java.lang.ProcessBuilder.start(
Caused by: error=2, No such file or directory
 at java.lang.UNIXProcess.forkAndExec(Native Method)
Build step 'Build With Grails' marked build as failure
Finished: FAILURE

You are probably configured the grails build to not use the Grails Wrapper and the local "Grails installation" has a problem or there is no local Grails installation.



Please verify that the Grails SDK you need for your job is properly configured at the Jenkins global configuration level. See How to declare a Grails SDK in Jenkins.

Special Thanks

Special thanks to Aurélien Maury from Xebia for his help!

Created by Cyrille Le Clerc on 2013/04/25 21:24