Skip to content

Instantly share code, notes, and snippets.

@grumpyshoe
Created September 26, 2019 12:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grumpyshoe/3c9d33ef0908a26c9c57c9c405068fe1 to your computer and use it in GitHub Desktop.
Save grumpyshoe/3c9d33ef0908a26c9c57c9c405068fe1 to your computer and use it in GitHub Desktop.
invalidate gradle dependecies for test purpose
# https://stackoverflow.com/questions/13565082/how-can-i-force-gradle-to-redownload-dependencies
# https://discuss.gradle.org/t/how-to-get-gradle-to-download-newer-snapshots-to-gradle-cache-when-using-an-ivy-repository/7344
# You can tell Gradle to re-download some dependencies in the build script by flagging
# the dependency as 'changing'. Gradle will then check for updates every 24 hours, but
# this can be configured using the resolutionStrategy DSL. I find it useful to use this
# for for SNAPSHOT or NIGHTLY builds.
configurations.all {
// Check for updates every build
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
# Expanded:
dependencies {
implementation group: "group", name: "projectA", version: "1.1-SNAPSHOT", changing: true
}
# Condensed:
implementation('group:projectA:1.1-SNAPSHOT') { changing = true }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment