You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by do...@apache.org on 2021/04/22 01:50:36 UTC
[spark] branch branch-3.1 updated: [SPARK-35178][BUILD] Use new
Apache 'closer.lua' syntax to obtain Maven
This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-3.1 by this push:
new 3c5b3e2 [SPARK-35178][BUILD] Use new Apache 'closer.lua' syntax to obtain Maven
3c5b3e2 is described below
commit 3c5b3e29c1ebb95c1de4765c695d1e6518c66f77
Author: Sean Owen <sr...@gmail.com>
AuthorDate: Wed Apr 21 18:49:19 2021 -0700
[SPARK-35178][BUILD] Use new Apache 'closer.lua' syntax to obtain Maven
### What changes were proposed in this pull request?
Use new Apache 'closer.lua' syntax to obtain Maven
### Why are the changes needed?
The current closer.lua redirector, which redirects to download Maven from a local mirror, has a new syntax. build/mvn does not work properly otherwise now.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Manual testing.
Closes #32277 from srowen/SPARK-35178.
Authored-by: Sean Owen <sr...@gmail.com>
Signed-off-by: Dongjoon Hyun <dh...@apple.com>
(cherry picked from commit 6860efe4688ea1057e7a2e57b086721e62198d44)
Signed-off-by: Dongjoon Hyun <dh...@apple.com>
---
build/mvn | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/build/mvn b/build/mvn
index 53a77f6..0863376 100755
--- a/build/mvn
+++ b/build/mvn
@@ -31,7 +31,7 @@ _COMPILE_JVM_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=1g"
## Arg2 - Tarball Name
## Arg3 - Checkable Binary
install_app() {
- local remote_tarball="$1/$2"
+ local remote_tarball="$1"
local local_tarball="${_DIR}/$2"
local binary="${_DIR}/$3"
@@ -71,19 +71,20 @@ install_mvn() {
local MVN_DETECTED_VERSION="$(mvn --version | head -n1 | awk '{print $3}')"
fi
if [ $(version $MVN_DETECTED_VERSION) -lt $(version $MVN_VERSION) ]; then
- local APACHE_MIRROR=${APACHE_MIRROR:-'https://www.apache.org/dyn/closer.lua?action=download&filename='}
-
+ local FILE_PATH="maven/maven-3/${MVN_VERSION}/binaries/apache-maven-${MVN_VERSION}-bin.tar.gz"
+ local APACHE_MIRROR=${APACHE_MIRROR:-'https://www.apache.org/dyn/closer.lua'}
+ local MIRROR_URL="${APACHE_MIRROR}/${FILE_PATH}?action=download"
+
if [ $(command -v curl) ]; then
- local TEST_MIRROR_URL="${APACHE_MIRROR}/maven/maven-3/${MVN_VERSION}/binaries/apache-maven-${MVN_VERSION}-bin.tar.gz"
- if ! curl -L --output /dev/null --silent --head --fail "$TEST_MIRROR_URL" ; then
+ if ! curl -L --output /dev/null --silent --head --fail "${MIRROR_URL}" ; then
# Fall back to archive.apache.org for older Maven
echo "Falling back to archive.apache.org to download Maven"
- APACHE_MIRROR="https://archive.apache.org/dist"
+ MIRROR_URL="https://archive.apache.org/dist/${FILE_PATH}"
fi
fi
install_app \
- "${APACHE_MIRROR}/maven/maven-3/${MVN_VERSION}/binaries" \
+ "${MIRROR_URL}" \
"apache-maven-${MVN_VERSION}-bin.tar.gz" \
"apache-maven-${MVN_VERSION}/bin/mvn"
@@ -123,7 +124,7 @@ install_scala() {
local TYPESAFE_MIRROR=${TYPESAFE_MIRROR:-https://downloads.lightbend.com}
install_app \
- "${TYPESAFE_MIRROR}/scala/${scala_version}" \
+ "${TYPESAFE_MIRROR}/scala/${scala_version}/scala-${scala_version}.tgz" \
"scala-${scala_version}.tgz" \
"scala-${scala_version}/bin/scala"
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org