首页 > 其他 > 详细

gradle 阿里全局镜像配置

时间:2017-12-29 18:37:24      阅读:1173      评论:0      收藏:0      [点我收藏+]

使用国内镜像阿里云,全局配置USER_HOME/.gradle/文件夹下,创建文件init.gradle

allprojects{
    repositories {
        def REPOSITORY_URL = ‘http://maven.aliyun.com/nexus/content/groups/public/‘
        all { ArtifactRepository repo ->
            if(repo instanceof MavenArtifactRepository){
                def url = repo.url.toString()
                if (url.startsWith(‘https://repo1.maven.org/maven2‘) || url.startsWith(‘https://jcenter.bintray.com/‘)) {
                    project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
                    remove repo
                }
            }
        }
        maven {
            url REPOSITORY_URL
        }
    }
}

 

gradle 阿里全局镜像配置

原文:https://www.cnblogs.com/chuancheng/p/8145785.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!