# Why use Gradle detached configurations?

**URL:** https://discuss.gradle.org/t/why-use-gradle-detached-configurations/9142
**Category:** Help/Discuss
**Created:** [April 17, 2015, 12:06am UTC](https://discuss.gradle.org/t/why-use-gradle-detached-configurations/9142 "2015-04-17T00:06:56Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![FredClausen](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/fredclausen/32/3772_2.png) [@FredClausen](https://discuss.gradle.org/u/FredClausen)
#### Post date: [April 17, 2015, 12:06am UTC](https://discuss.gradle.org/t/why-use-gradle-detached-configurations/9142/1 "2015-04-17T00:06:56Z")

</div>

I’m reading about Gradle’s detached dependency configurations and the [API docs’](https://gradle.org/docs/current/javadoc/org/gradle/api/artifacts/ConfigurationContainer.html) method description says “Creates a configuration, but does not add it to this container”. What I’d like to know is

- Why would I want to do this?
- At what point would I then use this dependency configuration?

Some initial searching revealed a [plugin related reason](http://discuss.gradle.org/t/plugins-should-use-detached-configurations-for-managing-their-user-defined-dependencies-instead-of-adding-configurations-to-the-projects-container/264) but this was not conclusive.

Thanks,

Fred.

_Note: I first posted this over on [SO](http://stackoverflow.com/questions/29640051/why-use-gradle-detached-configurations) but then decided these forums might be a better place to ask._

---

<div class="post-metadata">

### Author: ![Gary\_Hale](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/gary_hale/32/7647_2.png) [@Gary\_Hale](https://discuss.gradle.org/u/Gary_Hale)
#### Post date: [April 17, 2015, 12:56pm UTC](https://discuss.gradle.org/t/why-use-gradle-detached-configurations/9142/2 "2015-04-17T12:56:59Z")

</div>

One reason you might want to do this is that you might want to use Gradle’s resolution mechanism to resolve some artifact coordinates to an artifact in a more general way (say those coordinates come from some external source and not the build file). You can construct a detached configuration, resolve it, and then use the resolved artifact (say by adding it to a classloader or something). In general, you might use this as part of a plugin, but probably not in a build script anywhere.

---

<div class="post-metadata">

### Author: ![FredClausen](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/fredclausen/32/3772_2.png) [@FredClausen](https://discuss.gradle.org/u/FredClausen)
#### Post date: [April 21, 2015, 1:38am UTC](https://discuss.gradle.org/t/why-use-gradle-detached-configurations/9142/3 "2015-04-21T01:38:51Z")

</div>

That makes sense - thanks for the info! Feel free to add that answer to my [SO](http://stackoverflow.com/questions/29640051/why-use-gradle-detached-configurations) question if you want to score some fake internet points. Otherwise I can add it in.
