Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Gradle: task 'resolveDependencies' for CI
task resolveDependencies {
setDescription "Resolves all projects dependencies from the repository."
setGroup "Build Server"
doLast {
rootProject.allprojects { project ->
project.buildscript.configurations.forEach { configuration ->
if (configuration.canBeResolved) {
configuration.resolve()
}
}
project.configurations.forEach { configuration ->
if (configuration.canBeResolved) {
configuration.resolve()
}
}
}
}
}
@slamdev

This comment has been minimized.

Copy link

slamdev commented Feb 2, 2020

nice task, helped me a lot! small refactoring:

    doLast {
        rootProject.allprojects { project ->
            Set<Configuration> configurations = project.buildscript.configurations + project.configurations
            configurations.findAll { c -> c.canBeResolved }
                    .forEach { c -> c.resolve() }
        }
    }
@farukg

This comment has been minimized.

Copy link

farukg commented Aug 6, 2020

thx, very useful!
Helped me with a docker build issue throwing randomly SSL shut down incorrectly errors and also caching downloads of course

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.