# Dynamic load depenedency in the task

**URL:** <https://discuss.gradle.org/t/dynamic-load-depenedency-in-the-task/6248>\
**Category:** Old Forum Archive\
**Created:** [January 30, 2014, 8:54am UTC](https://discuss.gradle.org/t/dynamic-load-depenedency-in-the-task/6248 "2014-01-30T08:54:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alan\_Lee](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@Alan\_Lee](https://discuss.gradle.org/u/Alan_Lee)\
**Post date:** [January 30, 2014, 8:54am UTC](https://discuss.gradle.org/t/dynamic-load-depenedency-in-the-task/6248/1 "2014-01-30T08:54:00Z")

</div>

I want to load the dependency in the gradle task instead of being configuration stage (via beforeEvaluate) , is there any ways to load the dependency dynamically in the task ? i need to write my own one ?

Another question is about the dependency version. I want to get the exact 20140130.062809-1 version. How to mention in the dependency?

classpath “com.abc:plugin:2.0.3-20140130.062809-1” ? \<-- it fails

plugin-2.0.3-20140130.062809-1.jar

---

<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:** [January 30, 2014, 9:00am UTC](https://discuss.gradle.org/t/dynamic-load-depenedency-in-the-task/6248/2 "2014-01-30T09:00:00Z")

</div>

I don’t understand the first question. To answer the second question, I don’t think it’s currently possible to resolve a Maven snapshot dependency by its unique version.

---

<div class="post-metadata">

**Author:** ![Alan\_Lee](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@Alan\_Lee](https://discuss.gradle.org/u/Alan_Lee)\
**Post date:** [January 30, 2014, 9:29am UTC](https://discuss.gradle.org/t/dynamic-load-depenedency-in-the-task/6248/3 "2014-01-30T09:29:00Z")

</div>

My first question is to load the dependency dynmaically based on the argument of the task. When run the task, it reads the arguments and then load the dependency.

---

<div class="post-metadata">

**Author:** ![Alan\_Lee](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@Alan\_Lee](https://discuss.gradle.org/u/Alan_Lee)\
**Post date:** [January 30, 2014, 9:29am UTC](https://discuss.gradle.org/t/dynamic-load-depenedency-in-the-task/6248/4 "2014-01-30T09:29:00Z")

</div>

My first question is to load the dependency dynmaically based on the argument of the task. When run the task, it reads the arguments and then load the dependency.

---

<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:** [January 30, 2014, 9:31am UTC](https://discuss.gradle.org/t/dynamic-load-depenedency-in-the-task/6248/5 "2014-01-30T09:31:00Z")

</div>

It’s impossible to add task dependencies in the execution phase.
