zoukankan      html  css  js  c++  java
  • maven和gradle的全局阿里云镜像代理

    Maven:~/.m2/settings.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    
        <!-- 官网参考: http://maven.apache.org/guides/mini/guide-mirror-settings.html -->
        <mirrors>
            <mirror>
                <id>alimaven</id>
                <name>阿里云中央仓库</name>
                <mirrorOf>central,jcenter</mirrorOf>
                <url>https://maven.aliyun.com/repository/public/</url>
            </mirror>
        </mirrors>
    
    </settings>

    Gradle: ~/.gradle/init.gradle

    // 官网参考: https://docs.gradle.org/current/userguide/init_scripts.html#header
    allprojects {
        repositories {
            maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
            maven { url 'https://maven.aliyun.com/repository/public/' } 
            maven { url 'https://maven.aliyun.com/repository/google' }        
        }
    }
    // 验证:工程文件的build.gradle加入如下任务,并运行 gradle showRepos
    task showRepos {
        doLast {
            repositories.each {
                println "repository: ${it.name} ('${it.url}')"
            }
        }
    }

     

  • 相关阅读:
    Door man
    Borg Maze
    Agri-Net
    Highways
    Truck History
    Arctic Network
    QS Network
    用贝塞尔曲线实现水波效果
    在一个Label上设置多种颜色字体
    用UIImageView作出动画效果
  • 原文地址:https://www.cnblogs.com/hepengju/p/13288842.html
Copyright © 2011-2022 走看看