Gradleの国内ミラーリングを交換、倉庫のローカルアドレスを設定します

次のようにGradleのは、init.gradleファイルを作成するには、以下のパッケージとエキスのinit.dフォルダをインストールした後、国内のイメージを置き換えます

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
        }
    }
}

  gradle本地仓库地址配置:

 

おすすめ

転載: www.cnblogs.com/kgtone/p/10988092.html