Skip to content

Commit 506549f

Browse files
author
Matthew Farrellee
committed
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.
1 parent e380767 commit 506549f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

make-distribution.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ if [ -z "$JAVA_HOME" ]; then
8989
exit -1
9090
fi
9191

92-
VERSION=$(mvn help:evaluate -Dexpression=project.version 2>/dev/null | grep -v "INFO" | tail -n 1)
93-
if [ $? != 0 ]; then
92+
if ! which mvn &>/dev/null; then
9493
echo -e "You need Maven installed to build Spark."
9594
echo -e "Download Maven from https://maven.apache.org/"
9695
exit -1;
9796
fi
97+
VERSION=$(mvn help:evaluate -Dexpression=project.version 2>/dev/null | grep -v "INFO" | tail -n 1)
9898

9999
JAVA_CMD="$JAVA_HOME"/bin/java
100100
JAVA_VERSION=$("$JAVA_CMD" -version 2>&1)

0 commit comments

Comments
 (0)