Monday, October 14, 2019

Global gradle settings

If you have a local repo for all dependwencies you can include thi sin a global init.gradle file so that all builds pick it up (akin to the settings.xml in Maven)

init.gradle is stored in your $GRADLE_HOME (e.g. $HOME/.gradle)

e.g. here is an example

allprojects {
repositories {
        mavenLocal()
maven { url "http://myartifactory/repo1-cache"}
maven { url "http://myartifactory/libs-release"}
maven { url "http://myartifactory/libs-snapshot"}
}
buildscript {
repositories {
mavenLocal()
maven { url "http://myartifactory/repo1-cache"}
maven { url "http://myartifactory/libs-release"}
maven { url "http://myartifactory/libs-snapshot"}
}
}
}

If you need this updated in intelliJ , then you should run gradle warpper, and update the gradle/wrapper/gradle.properties, fixing the distributionUrl value