How can I force update all the snapshot Gradle dependencies in intellij

后端 未结 5 1960
臣服心动
臣服心动 2020-12-25 09:53

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.

5条回答
  •  甜味超标
    2020-12-25 10:04

    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

提交回复
热议问题