Resolve configuration of DefaultTask

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).

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:
solved.