File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// CI 环境(如 GitHub Actions 设置 CI=true)跳过国内 aliyun 镜像,
22// 直接使用 mavenCentral / google / gradlePluginPortal,避免镜像 5xx 把整个仓库 disable。
3- def useAliyunMirror = System . getenv( " CI " ) == null
4-
3+ // 注意:Gradle 9 要求 pluginManagement {} 必须是 settings.gradle 的第一个语句,
4+ // 不能在它之前声明任何变量/语句,因此这里在每个 repositories 块内联读取 env。
55pluginManagement {
66 repositories {
77 google()
88 gradlePluginPortal()
99 mavenCentral()
10- if (useAliyunMirror ) {
10+ if (System . getenv( " CI " ) == null ) {
1111 maven { url " https://maven.aliyun.com/repository/public" }
1212 maven { url " https://maven.aliyun.com/repository/google" }
1313 maven { url " https://maven.aliyun.com/repository/gradle-plugin" }
@@ -25,7 +25,7 @@ dependencyResolutionManagement {
2525 repositories {
2626 google()
2727 mavenCentral()
28- if (useAliyunMirror ) {
28+ if (System . getenv( " CI " ) == null ) {
2929 maven { url " https://maven.aliyun.com/repository/public" }
3030 maven { url " https://maven.aliyun.com/repository/google" }
3131 maven { url " https://maven.aliyun.com/repository/gradle-plugin" }
You can’t perform that action at this time.
0 commit comments