Configure --refresh-dependencies in init.gradle

Hi , I would like to configure --refresh-dependencies in init.gradle so that it need not be passed as command line for each individual project.

I configured like below

resolutionStrategy {
   cacheDynamicVersionsFor 0, "seconds"
          cacheChangingModulesFor 0, "seconds"

We also need to mention {changing=true} for those dependencies which needs to be refreshed.

The problem i face is that i want {changing=true} to be applied to all dependencies whose group name starts with specific string. Not sure whether it is possible to define matching group names in init.gradle . Let me know if there are any api to achieve this.

So you want to preset in init.gradle that any dependencies that might be declared in subprojects that have a particular group should always be changing=true?

Would something like this work?

rootProject {
  allprojects {
    afterEvaluation {
      configurations.compile.allDependencies.findAll { == "somegroup" }.each { it.changing=true }

Thanks Gary. This should work. I will try .

Thanks. It worked