在setting.grade文件中:
//pluginManagement { // repositories { // gradlePluginPortal() // google() // mavenCentral() // } //} //dependencyResolutionManagement { // repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) // repositories { // google() // mavenCentral() // jcenter() // } //}
改为:
pluginManagement {repositories {maven { url 'https://maven.aliyun.com/repository/public' }maven { url 'https://maven.aliyun.com/repository/google' }maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }maven { url 'https://clife-devops-maven.pkg.coding.net/repository/public-repository/maven-snapshots/' }gradlePluginPortal()mavenCentral()} } dependencyResolutionManagement {repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)repositories {maven { url 'https://maven.aliyun.com/repository/public' }maven { url 'https://maven.aliyun.com/repository/google' }maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }maven { url 'https://clife-devops-maven.pkg.coding.net/repository/public-repository/maven-snapshots/' }mavenCentral()} }
可以看到需要设置镜像节点进行相关包得下载同步