This is an automated email from the ASF dual-hosted git repository.
philo-he pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gluten.git
The following commit(s) were added to refs/heads/main by this push:
new 047e11e744 [MINOR] Retry transient Maven bootstrap downloads (#13663)
047e11e744 is described below
commit 047e11e744b39245b09e568b360dbefea7d0679a
Author: Felipe Pessoto <[email protected]>
AuthorDate: Fri Nov 20 14:00:12 2026 -0800
[MINOR] Retry transient Maven bootstrap downloads (#13663)
---
build/mvn | 61 ++++++++++++++++++++++++++++--------------
docs/developers/NewToGluten.md | 3 +++
2 files changed, 44 insertions(+), 20 deletions(-)
diff --git a/build/mvn b/build/mvn
index b66df5c907..8d3c78ad83 100755
--- a/build/mvn
+++ b/build/mvn
@@ -27,6 +27,46 @@ MVN_DOWNLOAD_DIR="${DOWNLOAD_DIR}/.mvn"
# Global variable for Maven binary path
MVN_BIN=""
+download_mvn() {
+ local URL="$1"
+ local DESTINATION="$2"
+ local PARTIAL="${DESTINATION}.part"
+ local -a DOWNLOAD_CMD
+ if command -v curl > /dev/null 2>&1; then
+ DOWNLOAD_CMD=(curl -f -L --retry 3 --retry-delay 3
+ --connect-timeout 30 --max-time 600 -o "$PARTIAL")
+ elif command -v wget > /dev/null 2>&1; then
+ DOWNLOAD_CMD=(wget --tries=3 --waitretry=3
+ --connect-timeout=30 --read-timeout=600 -O "$PARTIAL")
+ else
+ echo "ERROR: Neither curl nor wget found. Please install one of them
or install Maven manually." >&2
+ return 1
+ fi
+
+ local ATTEMPT STATUS
+ rm -f "$PARTIAL" || return 1
+ for ATTEMPT in 1 2 3; do
+ if "${DOWNLOAD_CMD[@]}" "$URL"; then
+ if mv -f "$PARTIAL" "$DESTINATION"; then
+ return 0
+ fi
+ echo "ERROR: Failed to save Maven download to ${DESTINATION}" >&2
+ rm -f "$PARTIAL"
+ return 1
+ else
+ STATUS=$?
+ fi
+ rm -f "$PARTIAL" || return 1
+ if [ "$ATTEMPT" -lt 3 ]; then
+ echo "Maven download attempt ${ATTEMPT}/3 failed
(${DOWNLOAD_CMD[0]} exit ${STATUS}); retrying in $((ATTEMPT * 60))s..." >&2
+ sleep "$((ATTEMPT * 60))" || return 1
+ fi
+ done
+
+ echo "ERROR: Failed to download Maven from ${URL} after 3 attempts
(${DOWNLOAD_CMD[0]} exit ${STATUS})" >&2
+ return 1
+}
+
# Read Maven version from pom.xml if not set
install_mvn() {
# Get Maven version from pom.xml using grep and sed
@@ -71,26 +111,7 @@ install_mvn() {
echo "Downloading Maven ${VERSION} from Maven Central..." >&2
echo "URL: ${DOWNLOAD_URL}" >&2
- if command -v curl > /dev/null 2>&1; then
- curl -f -L --retry 3 --retry-delay 3 \
- --connect-timeout 30 --max-time 600 \
- -o "${MVN_TAR}" "${DOWNLOAD_URL}" || {
- echo "ERROR: Failed to download Maven from
${DOWNLOAD_URL}" >&2
- rm -f "${MVN_TAR}"
- exit 1
- }
- elif command -v wget > /dev/null 2>&1; then
- wget --tries=3 --waitretry=3 \
- --connect-timeout=30 --read-timeout=600 \
- -O "${MVN_TAR}" "${DOWNLOAD_URL}" || {
- echo "ERROR: Failed to download Maven from
${DOWNLOAD_URL}" >&2
- rm -f "${MVN_TAR}"
- exit 1
- }
- else
- echo "ERROR: Neither curl nor wget found. Please install one
of them or install Maven manually." >&2
- exit 1
- fi
+ download_mvn "$DOWNLOAD_URL" "$MVN_TAR" || exit 1
echo "Download completed successfully" >&2
fi
diff --git a/docs/developers/NewToGluten.md b/docs/developers/NewToGluten.md
index 4e8affca0d..79c7f2c8e0 100644
--- a/docs/developers/NewToGluten.md
+++ b/docs/developers/NewToGluten.md
@@ -37,6 +37,9 @@
spark.executor.extraJavaOptions=-Dio.netty.tryReflectionSetAccessible=true
Gluten requires Maven 3.6.3 or above.
+`./build/mvn` uses the Maven version pinned in `pom.xml`, downloading it if
needed
+and retrying transient download failures.
+
### GCC
Gluten requires GCC 11 or above.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]