// 该init.gradle文件,请保存到${USER_HOME}/.gradle/文件夹下,如:C:\Users\Administrator\.gradle
allprojects {
repositories {
def REPOSITORY_URL = 'http://maven.aliyun.com/nexus/content/groups/public'
all { ArtifactRepository repo ->
if (repo instanceof MavenArtifactRepository) {
def url = repo.url.toString()
if (url.startsWith('https://repo1.maven.org/maven2') || url.startsWith('https://jcenter.bintray.com/')) {
project.logger.lifecycle "init.gradle[CUsersAdministrator.gradle]: Repository ${repo.url} replaced by $REPOSITORY_URL"
remove repo
}
}
}
maven {
url REPOSITORY_URL
}
}
}