安卓开发中的mave镜像设置

抵达项目根部的build.gradle文件中,将下方有关maven添加进去即可:

buildscript {
    repositories {
        maven { url ‘http://maven.aliyun.com/nexus/content/groups/public/‘ }
        maven { url ‘http://maven.aliyun.com/nexus/content/repositories/jcenter‘ }
        maven { url ‘http://maven.aliyun.com/nexus/content/repositories/google‘ }
        maven { url ‘http://maven.aliyun.com/nexus/content/repositories/gradle-plugin‘ }
        google()
        jcenter()
    }
    dependencies {
        classpath ‘com.android.tools.build:gradle:3.2.1‘
    }
}

allprojects {
    repositories {
        maven { url ‘http://maven.aliyun.com/nexus/content/groups/public/‘ }
        maven { url ‘http://maven.aliyun.com/nexus/content/repositories/jcenter‘ }
        maven { url ‘http://maven.aliyun.com/nexus/content/repositories/google‘ }
        maven { url ‘http://maven.aliyun.com/nexus/content/repositories/gradle-plugin‘ }
        google()
        jcenter()
    }
}

相关推荐