# Resolve configuration of DefaultTask

**URL:** <https://discuss.gradle.org/t/resolve-configuration-of-defaulttask/24922>\
**Category:** Help/Discuss\
**Created:** [November 27, 2017, 8:36pm UTC](https://discuss.gradle.org/t/resolve-configuration-of-defaulttask/24922 "2017-11-27T20:36:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nerro](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/nerro/32/5340_2.png) [@nerro](https://discuss.gradle.org/u/nerro)\
**Post date:** [November 27, 2017, 8:36pm UTC](https://discuss.gradle.org/t/resolve-configuration-of-defaulttask/24922/1 "2017-11-27T20:36:43Z")

</div>

Hey-hey,

I written a Gradle task to preload all dependencies on my CI server. All project dependencies were resolved except of dependencies from my custom task on ‘buildSrc’ project.  
My custom task extends DefaultTask and adds a custom configuration ‘wsimport’ to generate some JAXB from WSDL file.

I uploaded a sample project (with custom task and subproject) to Dropbox ([https://www.dropbox.com/s/royierndc0rui5q/gh-3608.zip?dl=0](https://www.dropbox.com/s/royierndc0rui5q/gh-3608.zip?dl=0)).

Can you point me in the right direction? Thanks.

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [November 28, 2017, 4:15pm UTC](https://discuss.gradle.org/t/resolve-configuration-of-defaulttask/24922/2 "2017-11-28T16:15:12Z")

</div>

You add your custom configuration `wsimport` during the execution phase of your custom task.  
This is _only_ done if your task is executed and _only_ at execution time of the task.  
So if you call `gradlew generateJaxbArtifacts resolveDependencies` your `wsimport` configuration will be found as long as your task is not `UP-TO-DATE`.

You should instead additionally use a plugin that you apply that adds the configuration at configuration phase and as your Gradle is new enough, you should also use `defaultDependencies` instead of checking whether the configuration is empty or not.

You can then either manually add your custom task to the project too, or your plugin can add the task and you just configure it in your build script.

---

<div class="post-metadata">

**Author:** ![nerro](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/nerro/32/5340_2.png) [@nerro](https://discuss.gradle.org/u/nerro)\
**Post date:** [November 28, 2017, 4:50pm UTC](https://discuss.gradle.org/t/resolve-configuration-of-defaulttask/24922/3 "2017-11-28T16:50:28Z")

</div>

it was the right direction 🙂  
solved.
