Force resolving (and downloading) all dependencies

Hello,

I have solved a similar use case.
The following script provides a task that can leverage the incremental task support of Gradle, without resolving configurations for other tasks (thanks to the task configuration avoidance api).

allprojects {
    tasks.register("downloadDependencies", Copy) { Copy copy ->
        copy.into project.layout.buildDirectory.dir("dependencies")
        copy.from {
            configurations.matching { Configuration c ->
                c.isCanBeResolved()
            }.collect { Configuration c ->
                c.resolve()
            }.flatten().unique()
        }
    }
}