Android国内Maven仓库

小豆苗 8月前 ⋅ 883 阅读

亲测可用。

最近开发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()
    }
}

全部评论: 0

    我有话说: