• gradle plugins/repos/wrapper/tools 国内快速同步下载镜像


    1. gradle bin  --- gradle wrapper zip

    官方 CDN 域名:downloads.gradle-dn.com 曾在中国落地,现已取消,无法继续使用。

    详见:https://github.com/china-speed/china-speed.github.io  (含各种前后端组件加速地址)

    # 腾讯云
    distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-6.6.1-bin.zip
    
    # 默认国外
    distributionUrl=https://services.gradle.org/distributions/gradle-6.6.1-bin.zip

    其他个人阿里云的Gradle wrapper zip包下载地址:
    https://www.kagura.me/dev/20200828131600.html

    阿里云gradle配置:
    https://maven.aliyun.com/mvn/guide

    腾讯国内镜像gradle下载地址:
    https://mirrors.cloud.tencent.com/gradle/

    Google站点:
    https://services.gradle.org/distributions/

     

    2.依赖库国内镜像

    /// project level build.gradle repos config / in China

    // google()
    // jcenter()
    // mavenLocal()
    // mavenCentral()
    // maven{url "https://jitpack.io"}
    // 腾讯云/阿里云 maven 镜像聚合了:central、jcenter、google、gradle-plugin
    maven { url 'https://mirrors.cloud.tencent.com/gradle/'}
    maven { url 'https://mirrors.cloud.tencent.com/nexus/repository/maven-public/' }
    maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
    maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
    maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
    maven { url 'https://maven.aliyun.com/repository/jcenter' }
    maven { url 'https://maven.aliyun.com/repository/google' }

    //// gradle tool config
    classpath 'com.android.tools.build:gradle:4.0.2'
    // classpath 'com.android.tools.build:gradle:4.1.1'
    // classpath 'com.android.tools.build:gradle:4.1.3'
    // classpath "com.android.tools.build:gradle:4.2.0"


    #### gradle wrapper config:

    #distributionUrl=https://services.gradle.org/distributions/gradle-6.4.1-all.zip
    #distributionUrl=https://services.gradle.org/distributions/gradle-6.5-all.zip
    #distributionUrl=https://services.gradle.org/distributions/gradle-6.7.1-all.zip
    #distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-6.7.1-all.zip
    distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-6.5-all.zip
    distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-6.4.1-all.zip
    #distributionUrl=file:///C:/Users/cmm/.gradle/wrapper/dists/gradle-6.4.1-all/13imxtezgn9nwzqt8rgtkunh1/gradle-6.4.1-all.zip
    #distributionUrl=file:///C:/Users/cmm/.gradle/wrapper/dists/gradle-6.5-all/2oz4ud9k3tuxjg84bbf55q0tn/gradle-6.5-all.zip
    #distributionUrl=file:///C:/Users/cmm/.gradle/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1-all.zip

    gradle快速镜像 配置参考:
    https://help.coding.net/docs/ci/depend/maven.html


    3.All in one 全局配置

    如本地开发需要加速,按照以下代码修改 ~/.gradle/init.gradle

    //for all project
    //在用户/.gradle/下创建init.gradle文件,内容如下:
    // https://blog.csdn.net/lj402159806/article/details/78422953
    def repoConfig = {
    all { ArtifactRepository repo ->
    if (repo instanceof MavenArtifactRepository) {
    def url = repo.url.toString()
    if (url.contains('repo1.maven.org/maven2')
    || url.contains('jcenter.bintray.com')
    || url.contains('maven.google.com')
    || url.contains('plugins.gradle.org/m2')
    || url.contains('repo.spring.io/libs-milestone')
    || url.contains('repo.spring.io/plugins-release')
    || url.contains('repo.grails.org/grails/core')
    || url.contains('repository.apache.org/snapshots')
    ) {
    println "gradle init: [buildscript.repositories] (${repo.name}: ${repo.url}) removed"
    remove repo
    }
    }
    }

    /// project level build.gradle repos config / in China
    // google()
    // jcenter()
    // mavenLocal()
    // mavenCentral()
    // maven{url "https://jitpack.io"}
    // 腾讯云/阿里云 maven 镜像聚合了:central、jcenter、google、gradle-plugin
    maven { url 'https://mirrors.cloud.tencent.com/gradle/'}
    maven { url 'https://mirrors.cloud.tencent.com/nexus/repository/maven-public/' }

    maven { url 'https://maven.aliyun.com/repository/central' }
    // jcenter & public
    maven { url 'https://maven.aliyun.com/repository/public' }
    maven { url 'https://maven.aliyun.com/repository/google' }
    maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
    }

    allprojects {
    buildscript {
    repositories repoConfig
    }

    repositories repoConfig
    }

  • 相关阅读:
    周末现场支持
    变量&字符串
    dead loop、continue & break、while...else语句
    运算符、流程控制、while循环
    二进制、字符编码、浮点数、列表
    字符串操作
    元祖、hash了解、字典、集合
    大数据处理
    含有虚函数的派生类的sizeof
    eclipse UML插件 安装和使用
  • 原文地址:https://www.cnblogs.com/bluestorm/p/14761482.html
Copyright © 2020-2023  润新知