Skip to content

Commit 91bf2c9

Browse files
committed
Add a fallback repository as GCS
1 parent e170422 commit 91bf2c9

2 files changed

Lines changed: 14 additions & 13 deletions

File tree

.github/workflows/master.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,6 @@ jobs:
6666
export MAVEN_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=1g -Dorg.slf4j.simpleLogger.defaultLogLevel=WARN"
6767
export MAVEN_CLI_OPTS="--no-transfer-progress"
6868
mkdir -p ~/.m2
69-
# `Maven Central` is too flaky in terms of downloading artifacts in `GitHub Action` environment.
70-
# `Google Maven Central Mirror` is too slow in terms of sycing upstream. To get the best combination,
71-
# 1) we set `Google Maven Central` as a mirror of `central` in `GitHub Action` environment only.
72-
# 2) we duplicates `Maven Central` in pom.xml with ID `central_without_mirror`.
73-
# In other words, in GitHub Action environment, `central` is mirrored by `Google Maven Central` first.
74-
# If `Google Maven Central` doesn't provide the artifact due to its slowness, `central_without_mirror` will be used.
75-
# Note that we aim to achieve the above while keeping the existing behavior of non-`GitHub Action` environment unchanged.
76-
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
7769
./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
7870
rm -rf ~/.m2/repository/org/apache/spark
7971

pom.xml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,14 +258,12 @@
258258
</snapshots>
259259
</repository>
260260
<repository>
261-
<id>central_without_mirror</id>
261+
<id>google-maven-central</id>
262262
<!--
263263
This is used as a fallback when a mirror to `central` fail.
264-
For example, when we use Google Maven Central in GitHub Action as a mirror of `central`,
265-
this will be used when Google Maven Central is out of sync due to its late sync cycle.
266264
-->
267-
<name>Maven Repository</name>
268-
<url>https://repo.maven.apache.org/maven2</url>
265+
<name>GCS Maven Central mirror</name>
266+
<url>https://maven-central.storage-download.googleapis.com/repos/central/data</url>
269267
<releases>
270268
<enabled>true</enabled>
271269
</releases>
@@ -285,6 +283,17 @@
285283
<enabled>false</enabled>
286284
</snapshots>
287285
</pluginRepository>
286+
<pluginRepository>
287+
<id>google-maven-central</id>
288+
<name>GCS Maven Central mirror</name>
289+
<url>https://maven-central.storage-download.googleapis.com/repos/central/data</url>
290+
<releases>
291+
<enabled>true</enabled>
292+
</releases>
293+
<snapshots>
294+
<enabled>false</enabled>
295+
</snapshots>
296+
</pluginRepository>
288297
</pluginRepositories>
289298
<dependencies>
290299
<!--

0 commit comments

Comments
 (0)