Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/12631#discussion_r60841120
--- Diff: build/mvn ---
@@ -67,17 +67,27 @@ install_app() {
fi
}
-# Install maven under the build/ folder
+# Determine the Maven version from the root pom.xml file and
+# install maven under the build/ folder if needed.
install_mvn() {
- local MVN_VERSION="3.3.9"
- local
APACHE_MIRROR=${APACHE_MIRROR:-'https://www.apache.org/dyn/closer.lua?action=download&filename='}
+ local MVN_VERSION=`grep "<maven.version>" "${_DIR}/../pom.xml" | \
+ head -1 | cut -f2 -d'>' | cut -f1 -d'<'`
+ MVN_BIN="$(command -v mvn)"
+ if [ "$MVN_BIN" ]; then
+ local MVN_DETECTED_VERSION="$(mvn --version | head -n1 | awk '{print
$3}')"
+ fi
+ # See simple version normalization:
http://stackoverflow.com/questions/16989598/bash-comparing-version-numbers
+ function version { echo "$@" | awk -F. '{ printf("%03d%03d%03d\n",
$1,$2,$3); }'; }
+ if [ $(version $MVN_DETECTED_VERSION) -lt $(version $MVN_VERSION) ]; then
--- End diff --
If there's no local version, then this always returns "false" as if the
detected version is 0?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]