diff --git a/.github/workflows/branch-2.4.yml b/.github/workflows/branch-2.4.yml index 85b456f3f1ea6..482a4a8c7c4ae 100644 --- a/.github/workflows/branch-2.4.yml +++ b/.github/workflows/branch-2.4.yml @@ -51,14 +51,6 @@ jobs: export MAVEN_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=512m -Dorg.slf4j.simpleLogger.defaultLogLevel=WARN" export MAVEN_CLI_OPTS="--no-transfer-progress" mkdir -p ~/.m2 - # `Maven Central` is too flaky in terms of downloading artifacts in `GitHub Action` environment. - # `Google Maven Central Mirror` is too slow in terms of sycing upstream. To get the best combination, - # 1) we set `Google Maven Central` as a mirror of `central` in `GitHub Action` environment only. - # 2) we duplicates `Maven Central` in pom.xml with ID `central_without_mirror`. - # In other words, in GitHub Action environment, `central` is mirrored by `Google Maven Central` first. - # If `Google Maven Central` doesn't provide the artifact due to its slowness, `central_without_mirror` will be used. - # Note that we aim to achieve the above while keeping the existing behavior of non-`GitHub Action` environment unchanged. - echo "google-maven-centralGCS Maven Central mirrorhttps://maven-central.storage-download.googleapis.com/repos/central/data/central" > ~/.m2/settings.xml ./build/mvn $MAVEN_CLI_OPTS -DskipTests -Pyarn -Pmesos -Pkubernetes -Phive -Phive-thriftserver -Pscala-${{ matrix.scala }} -P${{ matrix.hadoop }} -Phadoop-cloud install rm -rf ~/.m2/repository/org/apache/spark diff --git a/pom.xml b/pom.xml index c792671557c68..32b7bae32e6c4 100644 --- a/pom.xml +++ b/pom.xml @@ -231,10 +231,13 @@ - central - - Maven Repository - https://repo.maven.apache.org/maven2 + gcs-maven-central-mirror + + GCS Maven Central mirror + https://maven-central.storage-download.googleapis.com/repos/central/data/ true @@ -243,12 +246,10 @@ - central_without_mirror + central Maven Repository https://repo.maven.apache.org/maven2 @@ -260,6 +261,21 @@ + + gcs-maven-central-mirror + + GCS Maven Central mirror + https://maven-central.storage-download.googleapis.com/repos/central/data/ + + true + + + false + + central https://repo.maven.apache.org/maven2 diff --git a/project/SparkBuild.scala b/project/SparkBuild.scala index a27a344ba2e60..4a3f8a5959a39 100644 --- a/project/SparkBuild.scala +++ b/project/SparkBuild.scala @@ -222,6 +222,9 @@ object SparkBuild extends PomBuild { // Override SBT's default resolvers: resolvers := Seq( + // Google Mirror of Maven Central, placed first so that it's used instead of flaky Maven Central. + // See https://storage-download.googleapis.com/maven-central/index.html for more info. + "gcs-maven-central-mirror" at "https://maven-central.storage-download.googleapis.com/repos/central/data/", DefaultMavenRepository, Resolver.mavenLocal, Resolver.file("local", file(Path.userHome.absolutePath + "/.ivy2/local"))(Resolver.ivyStylePatterns)