Resolve configuration of DefaultTask


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 (

Can you point me in the right direction? Thanks.

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.

it was the right direction :slight_smile: