gradle配置源及地址

配置阿里云仓库

​ 在gradle目录下的init.d目录下创建init.gradle文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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 "Repository ${repo.url} replaced by $REPOSITORY_URL."
remove repo
}
}
}
maven {
url REPOSITORY_URL
}
}
}

你可能感兴趣的:(gradle配置源及地址)