Clover-for-Grails Quick Start Guide

This plugin integrates with Grails 2.x and is no longer maintained. Consider using a Gradle Clover Plugin for Grails 3.0 and newer.

Install the plugin

In case you use Grails older than 2.3.5 then you can install the Clover-for-Grails plugin by running the following Grails command in the root of your Grails project directory.

grails install-plugin clover

Generate a coverage report

To generate a basic Clover code coverage report, you need to add the Clover option -clover.on to the grails test-app command line target for running unit tests against your Grails project.

grails test-app -clover.on -clover.view

Troubleshooting

If you find that Clover-for-Grails runs out of memory, try increasing the Grails PermGen allocation by either setting the JAVA_OPTS environment variable:

Linux/UNIX/Mac OS X:
export JAVA_OPTS="-XX:MaxPermSize=192m"
Windows:
set JAVA_OPTS="-XX:MaxPermSize=192m"

Alternatively, you can define this variable in the startGrails (Linux/UNIX/Mac OS X) or startGrails.bat (Windows) script in the <Grails Home Directory>/bin directory.

Further reading