Created
September 26, 2019 12:16
-
-
Save grumpyshoe/3c9d33ef0908a26c9c57c9c405068fe1 to your computer and use it in GitHub Desktop.
invalidate gradle dependecies for test purpose
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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