Skip to content

Instantly share code, notes, and snippets.

@MRsoymilk
Created July 29, 2020 05:56
Show Gist options
  • Select an option

  • Save MRsoymilk/638f9192c2e7cf73c3c47da527ddef82 to your computer and use it in GitHub Desktop.

Select an option

Save MRsoymilk/638f9192c2e7cf73c3c47da527ddef82 to your computer and use it in GitHub Desktop.
gradle global repository
def repoConfig = {
all { ArtifactRepository repo ->
if (repo instanceof MavenArtifactRepository) {
def url = repo.url.toString()
if (url.contains('repo1.maven.org/maven2') || url.contains('jcenter.bintray.com')) {
println "gradle init: (${repo.name}: ${repo.url}) removed"
remove repo
}
}
}
maven { url 'https://maven.aliyun.com/repository/central' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
}
allprojects {
buildscript {
repositories repoConfig
}
repositories repoConfig
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment