文件路径:

C:\Users\laremehpe\.gradle\init.gradle
allprojects {
    repositories {
        def REPOSITORY_URL = 'https://maven.aliyun.com/repository/gradle-plugin'
        all { ArtifactRepository repo ->
            if (repo instanceof MavenArtifactRepository) {
                def url = repo.url.toString()
                if (url.startsWith('https://services.gradle.org') ||
                        url.startsWith('https://downloads.gradle.org')) {
                    project.logger.lifecycle "Changing repository URL for ${repo.url} to $REPOSITORY_URL."
                    repo.url = new URL(REPOSITORY_URL)
                }
            }
        }
    }
}

 

 posted on 2024-05-15 10:40  laremehpe  阅读(195)  评论(0编辑  收藏  举报