清凤

导航

 

C:\Users\BAEC\.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 {
	  allowInsecureProtocol = true
          url REPOSITORY_URL
    }
  }
}

  

posted on 2022-07-22 17:14  清凤  阅读(1101)  评论(0编辑  收藏  举报