I have a project with SNAPSHOT dependencies using gradle as its build tool in intellij.
The problem is that intellij is using SNAPSHOTS that are now outdated.
Gradle caches changing modules for 24 hours by default. We can tell Gradle to refresh or redownload dependencies in the build script by marking those as 'changing'.
Follow these steps:
Step #1: Tell Gradle not to cache changing modules by set the value of the cacheChangingModulesFor property to 0 second:
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
Step #2: Mark dependencies which are needed to be refreshed or redownloaded, as changing module:
dependencies {
compile("com.howtoprogram.buysell:payment-api:0.0.1-SNAPSHOT") {
changing = true
}
}
Source: Refresh or Redownload Dependencies in Gradle