I’ve cargo-culted configuration from various example files but I can’t determine why it isn’t running. For instance, I’ve tried adding this config to my build.gradle:
Unfortunately you cannot use the built in Jacoco plugin with the Grails plugin because it is reliant upon having a Java/Groovy project. Grails projects are not Java/Groovy projects in the Gradle world. This is because Grails has it’s own build system and Gradle is merely calling out to it. Think of it, as Gradle is forking a process and waiting for it to return.
If you want to perform code coverage for you Grails projects, you should install the (Grails Test Code Coverage Plugin)[http://grails.org/plugin/code-coverage] and then configure gradle to execute the ‘grails-test-app’ task with the additional ‘-coverage’ argument.
It MAY be possible to configure Jacoco for covering the Grails tests, but it would be fairly involved. You would need to get the Jacoco library into a configuration in Gradle (you can copy what the Gradle plugin does for this), and then configured the javagent string for the ‘grails-test-app’ task.