gradle mavenCentral()、jcenter()、google()仓库配置成阿里云

//buildscript里是gradle脚本执行所需依赖,分别是对应的maven库和插件
buildscript {
    repositories {
//        google()
//        jcenter()
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath 'com.novoda:bintray-release:+'
 
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
 
//allprojects里是项目本身需要的依赖
allprojects {
    repositories {
//        google()
//        jcenter()
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
    }
    tasks.withType(Javadoc) { // 新增
        options.addStringOption('Xdoclint:none', '-quiet')
        options.addStringOption('encoding', 'UTF-8')
    }
}
 
task clean(type: Delete) {
    delete rootProject.buildDir
}

mavenCentral()、jcenter()、google()仓库

https://blog.csdn.net/luoguopeng/article/details/91977554

gradle repository 设置国产阿里镜像仓库地址,加速下载jar包

https://lixuekai.blog.csdn.net/article/details/110482498

相关推荐
©️2020 CSDN 皮肤主题: 代码科技 设计师:Amelia_0503 返回首页