I am aware that I can use the groovy plugin to set this up and we are using spock this way for a number of our projects, but is there a way to do this without polluting the ‘compile’ and ‘runtime’ dependencies of the project with groovy artifacts?
In other words, is there a way to use groovy and spock for testing only and keep the external surface of the java project free of all traces of groovy?
does the trick. Gradle gurus, chime in if there is a better way. I saw the following comment on the groovy plugin:
footnote on ‘the groovy plugin can even deal with java only projects’: > > [9] We don’t recommend this, as the Groovy plugin uses the Groovyc Ant task to compile the sources. For pure Java projects you might rather stick with javac. In particular as you would have to supply a groovy jar for doing this.
so even with my exclude above, we are still using the wrong compiler.