Clover-for-Grails Installation Guide

This page provides instructions for all available Clover-for-Grails plug-in installation options.


The documentation below assumes that you have already installed Grails and have configured your PATH environment variable to point to the bin directory of your Grails installation.

Installing Clover-for-Grails

There are several ways to install Clover-for-Grails:

  • Declaring dependency in BuildConfig.groovy
  • Declaring dependency in pom.xml
  • Using the 'install-plugin' command
    • installing from the grails central repository
    • installing from the given web address
    • installing from the downloaded installation file

Upgrading Clover-for-Grails

Upgrading the Clover-for-Grails plugin is also very easy, as indicated here.

Installation of Clover for Grails plug-in

Using the BuildConfig.groovy

Edit your grails-app/conf/BuildConfig.groovy file and add a section like below:

grails.project.dependency.resolution = {
    plugins {
        compile "org.grails.plugins:clover:4.0.0"
    // For Grails 2.2 and later you have to add a dependency to a Clover core:
    dependencies { 
        compile "org.openclover:clover:4.0.0"
    // or use a legacy dependency resolution mechanism:
    // legacyResolve true

Using the pom.xml

Grails 2.1 has introduced new dependency management based on Maven's pom.xml instead of BuildConfig.groovy file. In order to use this, declare "pom true" in BuildConfig.groovy:

grails.project.dependency.resolution = {
    pom true

and add dependencies to org.grails.plugins:clover (and org.openclover:clover) in pom.xml:

<!-- For *Grails 2.2* or later you must also add a dependency to the Clover Core -->


Using the 'install-plugin' command

grails install-plugin clover 4.0.0


(warning) The 'install-plugin' command has been deprecated in Grails 2.1. It's recommended to use BuildConfig.groovy or pom.xml.

(warning) If you experience problems using this method, try installing the plugin directly from its web address:

grails install-plugin

Where x, y and z (optional) refer to the latest version of the Clover-for-Grails plugin to be installed.


It's also possible to install it from a downloaded file:

grails install-plugin /path/to/

Due to the nature of Grails' plugin installation architecture, you will need to install the Clover-for-Grails plugin into each Grails project whose source code you wish to test with Clover.

Related Topics