# Allow resolutionStrategy to remove dependency

**URL:** <https://discuss.gradle.org/t/allow-resolutionstrategy-to-remove-dependency/16094>\
**Category:** Help/Discuss\
**Created:** [April 7, 2016, 5:53am UTC](https://discuss.gradle.org/t/allow-resolutionstrategy-to-remove-dependency/16094 "2016-04-07T05:53:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ddimitrov](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/ddimitrov/32/141_2.png) [@ddimitrov](https://discuss.gradle.org/u/ddimitrov)\
**Post date:** [April 7, 2016, 5:53am UTC](https://discuss.gradle.org/t/allow-resolutionstrategy-to-remove-dependency/16094/1 "2016-04-07T05:53:30Z")

</div>

For example, in plugin builds I would like to be able to do:

```gradle
allprojects {
    configurations.all {
        resolutionStrategy {
            eachDependency { // skip Groovy artifacts as they are provided by gradleApi()
                if (requested.group == 'org.codehaus.groovy') useTarget null
            }
        }
    }
}

```

Right now we have a choice to _replace_ the Groovy deps with another irrelevant dependency, or to hunt down the transitives and exclude from each external dependency.

---

<div class="post-metadata">

**Author:** ![Schalk\_Cronje](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/schalk_cronje/32/6511_2.png) [@Schalk\_Cronje](https://discuss.gradle.org/u/Schalk_Cronje)\
**Post date:** [April 7, 2016, 10:34am UTC](https://discuss.gradle.org/t/allow-resolutionstrategy-to-remove-dependency/16094/2 "2016-04-07T10:34:25Z")

</div>

I would normally just do something like

```groovy
dependencies {
  compile 'a:b:1.0', {
    exclude module : 'groovy-all'
  }
}

```

but this can get overboard if your plugin depends on many other artififacts with groovy in their transitive dependencies, so have tried just doing

```groovy
configurations.all { exclude module: 'groovy-all' }

```
