问题:下载依赖jar包慢
解决:添加国内源
linux:/home/用户名/.gradle
windows:c:Users用户名.gradle
macos:/Users/用户名/.gradle
在.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
}
}
}