zoukankan      html  css  js  c++  java
  • 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'}
    }
    }

    ===

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

    allprojects{
    repositories {
    def ALIYUN_REPOSITORY_URL = 'http://maven.aliyun.com/nexus/content/groups/public'
    def ALIYUN_JCENTER_URL = 'http://maven.aliyun.com/nexus/content/repositories/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
    url ALIYUN_JCENTER_URL
    }
    }
    }

  • 相关阅读:
    jmeter单一接口测试
    mac os下载安装jmeter
    十、集成使用redis
    Java之Poi导出Excel文档
    134. Gas Station (Array; DP)
    53. Maximum Subarray (Array; DP)
    36. Valid Sudoku (Array; HashTable)
    37. Sudoku Solver (Array;Back-Track)
    52. N-Queens II (Array; Back-Track)
    51. N-Queens (Array; Back-Track, Bit)
  • 原文地址:https://www.cnblogs.com/anjunact/p/8260877.html
Copyright © 2011-2022 走看看