Maven镜像更换为阿里云中央仓库

复制代码

    
      alimaven
      aliyun maven
      http://maven.aliyun.com/nexus/content/groups/public/
      central        
    
  
复制代码

在maven的setting配置文件中添加如上代码

或者直接加在repositories里面:

    
        
            aliyunmaven
            http://maven.aliyun.com/nexus/content/groups/public/
        
    

就可以享受飞一般的下载速度了。

原来的maven地址应该是:

http://repo1.maven.org/maven2/

还有一个: http://central.maven.org/maven2/

但是也实在是太慢了。

 

在gradle里面配置如下:

复制代码
repositories {
    // maven库
    def cn = "http://maven.aliyun.com/nexus/content/groups/public/"
    def abroad = "http://central.maven.org/maven2/"
    // 先从url中下载jar若没有找到,则在artifactUrls中寻找
    maven {
        url cn
        artifactUrls abroad
    }
}
复制代码


你可能感兴趣的:(Maven镜像更换为阿里云中央仓库)