问题:下载依赖jar包慢

解决:添加国内源

linux:/home/用户名/.gradle

windows:c:\Users\用户名.gradle

macos:/Users/用户名/.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/')) {
                    remove repo
                }
            }
        }
        maven {
            url REPOSITORY_URL
        }
    }
}

相关文章:

  • 2021-12-11
  • 2021-09-28
  • 2021-05-13
  • 2021-11-25
  • 2021-04-20
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-21
  • 2021-11-09
  • 2022-12-23
  • 2021-08-20
  • 2021-06-26
  • 2021-06-05
  • 2021-04-29
相关资源
相似解决方案