Maven中设置阿里云中央仓库

把Maven中央仓库换成阿里云后,下载速度快了很多!

配置如下:

maven 配置方案

修改maven根目录下的conf文件夹中的setting.xml文件,内容如下:

< !--mirrors 中配置 mirror -->
<mirrors>
    <mirror>
      <id>alimavenid>
      <name>aliyun mavenname>
      <url>
          http://maven.aliyun.com/nexus/content/groups/public/
      url>
      <mirrorOf>centralmirrorOf>        
    mirror>
  mirrors>

gradle 配置方案

buildscript {
    repositories {
        // mavenCentral()
        // ... 
        // 在 repositories 中加入如下部分
        maven {
            name 'Aliyun Maven Repos'
            url 'http://maven.aliyun.com/nexus/content/groups/public/'
        }
    }
    dependencies {
        ... 
    }
}

接下来,带宽只要给力就可以享受飞一般的速度了.O(∩_∩)O哈哈~~~

Good Luck !

你可能感兴趣的:(Maven)