# compileGroovy task can't find Groovy library

**URL:** <https://discuss.gradle.org/t/compilegroovy-task-cant-find-groovy-library/1055>\
**Category:** Old Forum Archive\
**Created:** [February 27, 2013, 10:29pm UTC](https://discuss.gradle.org/t/compilegroovy-task-cant-find-groovy-library/1055 "2013-02-27T22:29:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![edvorkin](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/edvorkin/32/291_2.png) [@edvorkin](https://discuss.gradle.org/u/edvorkin)\
**Post date:** [February 27, 2013, 10:29pm UTC](https://discuss.gradle.org/t/compilegroovy-task-cant-find-groovy-library/1055/1 "2013-02-27T22:29:00Z")

</div>

I am trying to compile mixed java-groovy project using groovy compilation and it’s failing with error

```gradle
$ gradle jar
:compileJava SKIPPED
:compileGroovy FAILED
You must assign a Groovy library to the 'groovy' configuration.

```

I got latest version of groovy and my build.gradle file has following snipped:

```gradle
compileJava.enabled = false
 sourceSets {
  main {
     groovy {
    srcDir 'src/main/java'
     }
  }
  test {
   groovy {
    srcDir 'src/test/java'
   }
  }
 }
  dependencies {
    compile group: 'commons-collections', name: 'commons-collections', version: '3.2'
    testCompile group: 'junit', name: 'junit', version: '4.+'
 compile 'storm:storm:0.8.2'
    compile "org.mongodb:mongo-java-driver:2.10.0"
    compile 'mysql:mysql-connector-java:5.1.22'
    compile 'vertica:vertica-jdbc:6.0.1'
    compile 'org.codehaus.groovy:groovy-all:2.1.1'
       }

```

I can’t make sence of error message. What is wrong with my build file and what I can do to resolve the issue?

Thanks

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [February 27, 2013, 11:00pm UTC](https://discuss.gradle.org/t/compilegroovy-task-cant-find-groovy-library/1055/2 "2013-02-27T23:00:00Z")

</div>

This build script should work when using Gradle 1.4 or higher, but it looks like you are using an earlier Gradle version. In that case, the Groovy dependency has to go on the ‘groovy’ configuration, not on ‘compile’.
