gradle 配置阿里云

~/.gradle/init.gradle

allprojects{  
  repositories {  
    def REPOSITORY_URL = 'http://maven.aliyun.com/nexus/content/groups/public/'  
      all { ArtifactRepository repo ->  
        if(repo instanceof MavenArtifactRepository){  
          def url = repo.url.toString()  
          if (url.startsWith('https://repo1.maven.org/maven2') || url.startsWith('https://jcenter.bintray.com/')) {  
            project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."  
            remove repo  
          }  
       }  
    }  
    maven {  
      url REPOSITORY_URL  
    }  
  }  
}  

版权声明:本文为zhubinqiang原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。