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
    }
    }
    }

  • 相关阅读:
    008 WEBmvc的自动配置
    007 springboot的日志问题
    006 自动配置
    005 profile
    004 引入spring的xml配置文件
    003 场景启动器
    002 依赖管理
    001-属性文件
    TypeError: FileBox.fromUrl is not a function
    npm 的是报错 @XXXXX postinstall 处理
  • 原文地址:https://www.cnblogs.com/anjunact/p/8260877.html
Copyright © 2011-2022 走看看