aboutsummaryrefslogtreecommitdiff
path: root/make-distribution.sh
diff options
context:
space:
mode:
authorMatthew Farrellee <matt@redhat.com>2014-06-23 11:24:05 -0700
committerPatrick Wendell <pwendell@gmail.com>2014-06-23 11:25:06 -0700
commitcf2fa4fe344102d7d8e492efa87de2cb0db7f507 (patch)
tree262f6a6317795e5d803954388c5bc35d9e30e178 /make-distribution.sh
parentd51eba56caa10257491b9cfdbef95863b1d1b989 (diff)
downloadspark-cf2fa4fe344102d7d8e492efa87de2cb0db7f507.tar.gz
spark-cf2fa4fe344102d7d8e492efa87de2cb0db7f507.tar.bz2
spark-cf2fa4fe344102d7d8e492efa87de2cb0db7f507.zip
Fix mvn detection
When mvn is not detected (not in executor's path), 'set -e' causes the detection to terminate the script before the helpful error message can be displayed. Author: Matthew Farrellee <matt@redhat.com> Closes #1181 from mattf/master-0 and squashes the following commits: 506549f [Matthew Farrellee] Fix mvn detection (cherry picked from commit 853a2b951d4c7f6c6c37f53b465b3c7b77691b7c) Signed-off-by: Patrick Wendell <pwendell@gmail.com>
Diffstat (limited to 'make-distribution.sh')
-rwxr-xr-xmake-distribution.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/make-distribution.sh b/make-distribution.sh
index ae52b4976d..6f708e0ebf 100755
--- a/make-distribution.sh
+++ b/make-distribution.sh
@@ -89,12 +89,12 @@ if [ -z "$JAVA_HOME" ]; then
exit -1
fi
-VERSION=$(mvn help:evaluate -Dexpression=project.version 2>/dev/null | grep -v "INFO" | tail -n 1)
-if [ $? != 0 ]; then
+if ! which mvn &>/dev/null; then
echo -e "You need Maven installed to build Spark."
echo -e "Download Maven from https://maven.apache.org/"
exit -1;
fi
+VERSION=$(mvn help:evaluate -Dexpression=project.version 2>/dev/null | grep -v "INFO" | tail -n 1)
JAVA_CMD="$JAVA_HOME"/bin/java
JAVA_VERSION=$("$JAVA_CMD" -version 2>&1)