第一种方法
使用开源中国的maven库
阿里云的(速度飞快):http://maven.aliyun.com/nexus/content/groups/public/
替换项目根目录下build.gradle中的
repositories {
jcenter()
}
- 1
- 2
- 3
为:
repositories {
maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}
}
- 1
- 2
- 3
第二种方法
修改https为 http协议下载
替换项目根目录下build.gradle中的
repositories {
jcenter()
}
- 1
- 2
- 3
为:
repositories {
jcenter(){ url 'http://jcenter.bintray.com/'}
}
本文介绍两种加快Maven依赖下载速度的方法:一是更换为阿里云的Maven仓库;二是将默认的https协议改为http协议来下载依赖。

被折叠的 条评论
为什么被折叠?



