# How can I build a plugin that depends on a resolved resource?

**URL:** https://discuss.gradle.org/t/how-can-i-build-a-plugin-that-depends-on-a-resolved-resource/4359
**Category:** Old Forum Archive
**Created:** [November 29, 2011, 2:54pm UTC](https://discuss.gradle.org/t/how-can-i-build-a-plugin-that-depends-on-a-resolved-resource/4359 "2011-11-29T14:54:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![legit](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/legit/32/635_2.png) [@legit](https://discuss.gradle.org/u/legit)
#### Post date: [November 29, 2011, 2:54pm UTC](https://discuss.gradle.org/t/how-can-i-build-a-plugin-that-depends-on-a-resolved-resource/4359/1 "2011-11-29T14:54:00Z")

</div>

I can’t figure out how to invoke dependency resolving and I can’t figure out where the dependency’s get resolved and stored at. I want to resolve a jar and that my plugin will rely on, whats the procedure for this. Also, is there a task that will only resolve my dependencies?

---

<div class="post-metadata">

### Author: ![legit](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/legit/32/635_2.png) [@legit](https://discuss.gradle.org/u/legit)
#### Post date: [November 29, 2011, 3:19pm UTC](https://discuss.gradle.org/t/how-can-i-build-a-plugin-that-depends-on-a-resolved-resource/4359/2 "2011-11-29T15:19:00Z")

</div>

I think I may have found half of the answer here: [http://www.gradle.org/releases/0.8/docs/userguide/organizing\_build\_logic.html#sec:external\_dependencies](http://www.gradle.org/releases/0.8/docs/userguide/organizing_build_logic.html#sec:external_dependencies)

I’m still not sure where the dependencies are stored on the machine, which I’d like to know to erase some magic.

Also, what is the procedure when building a plugin that has an external dependency (package the dependency with the plugin, or tell users to add the dependency to their build script, or something else)?

---

<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: [November 29, 2011, 11:45pm UTC](https://discuss.gradle.org/t/how-can-i-build-a-plugin-that-depends-on-a-resolved-resource/4359/3 "2011-11-29T23:45:00Z")

</div>

> I can’t figure out how to invoke dependency resolving and I can’t figure out where the dependency’s get resolved and stored at.

Configurations are resolved on-the-fly when needed, e.g. when you iterate over them. Artifacts are stored in ~/.gradle/caches/artifacts-x/.

> I want to resolve a jar and that my plugin will rely on, whats the procedure for this.

Add the dependency to a configuration and iterate over the configuration (or call ‘resolve()’).

> Also, what is the procedure when building a plugin that has an external dependency (package the dependency with the plugin, or tell users to add the dependency to their build script, or something else)?

Typically you publish a pom.xml or ivy.xml along with your plugin and transitive dependency management takes care of the rest.
