bmuschko / gradle-clover-plugin

Gradle plugin for generating a code coverage report using Clover
Apache License 2.0
74 stars 49 forks source link

Grails 3 project fails to find Groovyc class #89

Closed Alex-Vol closed 7 years ago

Alex-Vol commented 7 years ago

Similar to the older issue #59 a Grails 3 project requires the addition of groovy compile dependency to compile Groovy tests.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':test'.
> taskdef class org.codehaus.groovy.ant.Groovyc cannot be found

Current workaround is:

compile 'org.codehaus.groovy:groovy-all:2.4.7'

or

provided 'org.codehaus.groovy:groovy-all:2.4.7'

where 2.4.7 is an appropriate groovy version for your project and provided has to be a correct and available configuration scope for your project. I believe Grails defines a provided configuration scope.

Alex-Vol-SV commented 7 years ago

The use of Groovy in this plugin is designed to work with Groovy in the compile classpath. I can attempt adding Gradle internal Groovy libraries in the classpath when invoking the Groovyc compiler but I am concerned this might inject improper dependency to Groovy in the code under test.

The current workaround to add groovy-all in compile or provided configuration may be an acceptable one if there are no other options.