xiaolyuh123的專欄
阿新 • • 發佈:2018-12-16
改單個專案
repositories {
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
}
更改所有專案
如果想一次更改所有的倉庫地址,可以在 USER_HOME/.gradle/
資料夾下新增 init.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/')) { remove repo } } } maven { url REPOSITORY_URL } } }