Prevent a dependency from being used in parent project

i think I am having trouble with using the correct terminology which is why I cannot find an answer to this.

My build.gradle has the following dependencies :

dependencies {
    compile 'org.codehaus.groovy:groovy-all:2.3.6'
    testCompile 'junit:junit:4.11'
}

how do I configure the groovy dependency so that when this project becomes a dependency of another, groovy isn’t installed as a dependency? The intention is to use the version of groovy in the parent project.

Thanks, John

In short you need to create a new configuration for the groovy dependency and add it to the compile classpath. The ‘runtime’ configuration is what is exported to the parent projects.

http://forums.gradle.org/gradle/topics/how_do_i_best_define_dependencies_as_provided