diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 7524ac64f3b92..e4d2d8470cc34 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -66,6 +66,13 @@ jobs: export MAVEN_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=1g -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 -P${{ matrix.hive }} -Phive-thriftserver -P${{ matrix.hadoop }} -Phadoop-cloud -Djava.version=${{ matrix.java }} install rm -rf ~/.m2/repository/org/apache/spark diff --git a/pom.xml b/pom.xml index 58c05357ef417..33a219f764465 100644 --- a/pom.xml +++ b/pom.xml @@ -257,6 +257,22 @@ false + + central_without_mirror + + Maven Repository + https://repo.maven.apache.org/maven2 + + true + + + false + +