美文网首页
Gradle 配置阿里云仓库

Gradle 配置阿里云仓库

作者: ag4kd | 来源:发表于2019-10-25 10:16 被阅读0次

    解决Gradle依赖同步慢的问题,仅供参考,我不这么用。

    
    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    
    buildscript({
        repositories {
            //首先去阿里云的仓库去找
            maven{
                url{'http://maven.aliyun.com/nexus/content/groups/public/'}
            }
            //如果找不到,就去Google仓库去找
            google()
            //再找不到,就去jcenter仓库去找
            jcenter()
    
        }
        dependencies {
            classpath 'command.android.tools.build:gradle:3.5.0'
    
            // 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/'}
            }
            google()
            jcenter()
    
        })
    })
    
    task clean(type: Delete) {
        println('-------' + rootProject.buildDir)
    //    delete rootProject.buildDir
    }
    

    相关文章

      网友评论

          本文标题:Gradle 配置阿里云仓库

          本文链接:https://www.haomeiwen.com/subject/wnxsvctx.html