[GRADLE-1447] Use Gradle's provided Groovy library as default for 'groovy' dependency (Groovy plugin) Created: 17/Mar/11  Updated: 04/Jan/13  Resolved: 21/Jun/11

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-milestone-1
Fix Version/s: 1.0

Type: Improvement
Reporter: Benjamin Muschko Assignee: Luke Daley
Resolution: Won't Fix Votes: 0


 Description   

The Groovy plugin requires the definition of the 'groovy' dependency like this:

apply plugin: 'groovy'

dependencies {
    groovy group: 'org.codehaus.groovy', name: 'groovy', version: '1.7.6'
}

Gradle already ships with a groovy-all library. I think it would be great if we could simply assign that library so the user doesn't have to define the dependency. If the user wants to assign a different Groovy version he/she can still do that in the dependencies closure. At the moment I am using this workaround:

dependencies {
    groovy fileTree(dir: new File(gradle.gradleHomeDir, 'lib'), includes: ['**/groovy-all-*.jar'])
}


 Comments   
Comment by Luke Daley [ 21/Jun/11 ]

Using it as a default is a bit risky, but there is a shorthand notation for this which is a good compromise.

groovy localGroovy()

This was added to the docs in 1.0 m4.

Note that this doesn't export as a dependency, so won't show up in your POM if you are producing one (which is usually the desired behaviour if you want to use Gradle's groovy).

Generated at Wed Jun 30 11:55:45 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.