File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 5151 export MAVEN_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=512m -Dorg.slf4j.simpleLogger.defaultLogLevel=WARN"
5252 export MAVEN_CLI_OPTS="--no-transfer-progress"
5353 mkdir -p ~/.m2
54+ # `Maven Central` is too flaky in terms of downloading artifacts in `GitHub Action` environment.
55+ # `Google Maven Central Mirror` is too slow in terms of sycing upstream. To get the best combination,
56+ # 1) we set `Google Maven Central` as a mirror of `central` in `GitHub Action` environment only.
57+ # 2) we duplicates `Maven Central` in pom.xml with ID `central_without_mirror`.
58+ # In other words, in GitHub Action environment, `central` is mirrored by `Google Maven Central` first.
59+ # If `Google Maven Central` doesn't provide the artifact due to its slowness, `central_without_mirror` will be used.
60+ # Note that we aim to achieve the above while keeping the existing behavior of non-`GitHub Action` environment unchanged.
5461 echo "<settings><mirrors><mirror><id>google-maven-central</id><name>GCS Maven Central mirror</name><url>https://maven-central.storage-download.googleapis.com/repos/central/data/</url><mirrorOf>central</mirrorOf></mirror></mirrors></settings>" > ~/.m2/settings.xml
5562 ./build/mvn $MAVEN_CLI_OPTS -DskipTests -Pyarn -Pmesos -Pkubernetes -Phive -Phive-thriftserver -Pscala-${{ matrix.scala }} -P${{ matrix.hadoop }} -Phadoop-cloud install
5663 rm -rf ~/.m2/repository/org/apache/spark
Original file line number Diff line number Diff line change 242242 <enabled >false</enabled >
243243 </snapshots >
244244 </repository >
245+ <repository >
246+ <id >central_without_mirror</id >
247+ <!--
248+ This is used as a fallback when a mirror to `central` fail.
249+ For example, when we use Google Maven Central in GitHub Action as a mirror of `central`,
250+ this will be used when Google Maven Central is out of sync due to its late sync cycle.
251+ -->
252+ <name >Maven Repository</name >
253+ <url >https://repo.maven.apache.org/maven2</url >
254+ <releases >
255+ <enabled >true</enabled >
256+ </releases >
257+ <snapshots >
258+ <enabled >false</enabled >
259+ </snapshots >
260+ </repository >
245261 </repositories >
246262 <pluginRepositories >
247263 <pluginRepository >
You can’t perform that action at this time.
0 commit comments