Skip to content

Commit

Permalink
Fix mvn detection
Browse files Browse the repository at this point in the history
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 apache#1181 from mattf/master-0 and squashes the following commits:

506549f [Matthew Farrellee] Fix mvn detection
  • Loading branch information
mattf authored and pwendell committed Jun 23, 2014
1 parent b88238f commit 853a2b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions make-distribution.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 853a2b9

Please sign in to comment.