我是靠谱客的博主 大力酒窝,这篇文章主要介绍Gradle配置国内镜像Gradle配置国内镜像,现在分享给大家,希望可以做个参考。

Gradle配置国内镜像

Gradle常用于构建项目,当使用Gradle需要从服务器下载依赖包时速度非常慢,其原因是服务器在国外。而国内有些大厂就建立了这些内容在国内的镜像,我们可以配置让Gradle从国内的镜像服务器下载内容。从此速度飞起。

对单个项目有效

在项目的build.gradle文件中添加以下内容

buildscript {
    repositories {
        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'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }        
}

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

对所有项

最后

以上就是大力酒窝最近收集整理的关于Gradle配置国内镜像Gradle配置国内镜像的全部内容,更多相关Gradle配置国内镜像Gradle配置国内镜像内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(103)

评论列表共有 0 条评论

立即
投稿
返回
顶部