亲测可用。
最近开发android时,发现部分库下载异常慢。出于无奈并猜测阿里云可能有替代品,找了下,果然还真有,现在奉献出来给需要的小伙伴。希望对大家有帮助。
central https://maven.aliyun.com/repository/central
jcenter https://maven.aliyun.com/repository/public
public https://maven.aliyun.com/repository/public
google https://maven.aliyun.com/repository/google
gradle-plugin https://maven.aliyun.com/repository/gradle-plugin
spring https://maven.aliyun.com/repository/spring
spring-plugin https://maven.aliyun.com/repository/spring-plugin
grails-core https://maven.aliyun.com/repository/grails-core
apache snapshots https://maven.aliyun.com/repository/apache-snapshots
在android studio的工程中,你需要在build.gradle中添加:
buildscript {
repositories {
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/central' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.1"
}
}
allprojects {
repositories {
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/central' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
google()
jcenter()
}
}
注意:本文归作者所有,未经作者允许,不得转载
原文地址: http://blog.wsmee.com/post/175
版权声明:非商用-非衍生-保持署名| Creative Commons BY-NC-ND 3.0