Can I add maven repository to all sources at once?


(xcq1) #1

Currently I have my Gradlefile like this:

buildscript {
...
  repositories {
    maven { url "http://my.artifactory.url/artifactory/maven-mirrors/" }
  }
}
plugins {
  ...
}
...
repositories {
  maven { url "http://my.artifactory.url/artifactory/maven-mirrors/" }
}
...

And recently I’ve realized that the plugins are not using that mirror but this can probably be fixed by adding

pluginManagement {
  repositories {
      maven { url "http://my.artifactory.url/artifactory/maven-mirrors/" }
  }
}

to the settings.gradle.

However if I have to change the URL I now have to change 3 different places at once. Is there an easy way to centralize this, so I only have to change one place?