• 在init.gradle使用阿里云gradle-plugin代替plugins.gradle.org


        本人已在gradle 3.3下测试可用,使用3.3版本主要是调试elasticsearch 5.5用的。

    init.gradle

    allprojects{
        repositories {
            def ALIYUN_REPOSITORY_URL = 'https://maven.aliyun.com/repository/central/'
            def ALIYUN_JCENTER_URL = 'https://maven.aliyun.com/repository/jcenter/'
            all { ArtifactRepository repo ->
                if(repo instanceof MavenArtifactRepository){
                    def url = repo.url.toString()
                    if (url.startsWith('https://repo1.maven.org/maven2/')) {
                        project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_REPOSITORY_URL."
                        remove repo
                    }
                    if (url.startsWith('https://jcenter.bintray.com/')) {
                        project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_JCENTER_URL."
                        remove repo
                    }
                }
            }
            maven { url ALIYUN_REPOSITORY_URL }
            maven { url ALIYUN_JCENTER_URL }
        }
    
        buildscript {
            repositories {
                def ALIYUN_GRADLE_PLUGIN_URL = 'https://maven.aliyun.com/repository/gradle-plugin/'
                all { ArtifactRepository repo ->
                    if(repo instanceof MavenArtifactRepository){
                        def url = repo.url.toString()
                        if (url.startsWith('https://plugins.gradle.org/m2/')) {
                            project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_GRADLE_PLUGIN_URL."
                            remove repo
                        }
                    }
                }
                maven { url ALIYUN_GRADLE_PLUGIN_URL }
            }
        }
    }

    output:

    <省略...>
    Repository https://plugins.gradle.org/m2/ replaced by https://maven.aliyun.com/repository/gradle-plugin/. Download https://maven.aliyun.com/repository/gradle-plugin/com/github/jengelman/gradle/plugins/shadow/1.2.3/shadow-1.2.3.pom Download https://maven.aliyun.com/repository/gradle-plugin/org/jdom/jdom2/2.0.5/jdom2-2.0.5.pom Download https://maven.aliyun.com/repository/gradle-plugin/org/ow2/asm/asm/5.0.3/asm-5.0.3.pom Download https://maven.aliyun.com/repository/gradle-plugin/org/ow2/asm/asm-parent/5.0.3/asm-parent-5.0.3.pom Download https://maven.aliyun.com/repository/gradle-plugin/org/ow2/ow2/1.3/ow2-1.3.pom Download https://maven.aliyun.com/repository/gradle-plugin/org/ow2/asm/asm-commons/5.0.3/asm-commons-5.0.3.pom Download https://maven.aliyun.com/repository/gradle-plugin/org/apache/ant/ant/1.9.4/ant-1.9.4.pom Download https://maven.aliyun.com/repository/gradle-plugin/org/apache/ant/ant-parent/1.9.4/ant-parent-1.9.4.pom Download https://maven.aliyun.com/repository/gradle-plugin/org/codehaus/plexus/plexus-utils/2.0.6/plexus-utils-2.0.6.pom Download https://maven.aliyun.com/repository/gradle-plugin/org/codehaus/groovy/groovy-backports-compat23/2.4.4/groovy-backports-compat23-2.4.4.pom Download https://maven.aliyun.com/repository/gradle-plugin/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.pom Download https://maven.aliyun.com/repository/gradle-plugin/org/apache/ant/ant-launcher/1.9.4/ant-launcher-1.9.4.pom Download https://maven.aliyun.com/repository/gradle-plugin/com/github/jengelman/gradle/plugins/shadow/1.2.3/shadow-1.2.3.jar Download https://maven.aliyun.com/repository/gradle-plugin/org/jdom/jdom2/2.0.5/jdom2-2.0.5.jar
    Download https://maven.aliyun.com/repository/gradle-plugin/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar
    <省略...>
  • 相关阅读:
    swift 对于NSDate日期获取年月日及其他操作
    Swift 的 NSDate 初学者指南
    swift之Mac中NSSlider的使用
    oc之mac中自定义NSSlider
    oc及swift之mac中NSPopUpButton
    swift之NSComboBox
    oc之NSComboBox输入字符时自动打开下拉菜单并匹配
    swift之Mac中NSScrollView的用法即滚动条隐藏和禁止滚动
    iOS 设置图片的透明度
    iOS 对象数组生成jsonarray
  • 原文地址:https://www.cnblogs.com/highend/p/gradle_plugins_use_aliyun_mirror.html
Copyright © 2020-2023  润新知