gradle 国内镜像源配置

gradle 国内镜像源配置

buildscript {
    repositories {
        //先从本地加载
        mavenLocal()
        maven { url 'http://maven.aliyun.com/repository/central' }
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
    }        
}
//如有plugins 则需要放在buildscript 后面
plugins{

}
allprojects {
    repositories {
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
        maven{ url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
    }
}

参考:
https://blog.csdn.net/zhaokai0130/article/details/81008719

上一篇:使用Nexus搭建npm私服


下一篇:【转】maven的配置文件中已经配置了阿里云镜像但是仍然会从*仓库下载maven依赖很慢-解决方案