Skip to content

Commit bf821b9

Browse files
author
Rahul Singhal
committed
SPARK-1658: Correctly identify if maven is installed and working
The current test is checking the exit code of "tail" rather than "mvn". This new check will make sure that mvn is installed and was able to execute the "version command".
1 parent f735884 commit bf821b9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

make-distribution.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@
4343
FWDIR="$(cd `dirname $0`; pwd)"
4444
DISTDIR="$FWDIR/dist"
4545

46-
VERSION=$(mvn help:evaluate -Dexpression=project.version | grep -v "INFO" | tail -n 1)
47-
if [ $? == -1 ] ;then
46+
VERSION_TEXT=$(mvn help:evaluate -Dexpression=project.version 2>/dev/null)
47+
if [ $? != 0 ] ;then
4848
echo -e "You need Maven installed to build Spark."
4949
echo -e "Download Maven from https://maven.apache.org."
5050
exit -1;
5151
fi
52+
VERSION=$(echo "$VERSION_TEXT" | grep -v "INFO" | tail -n 1)
5253

5354
# Initialize defaults
5455
SPARK_HADOOP_VERSION=1.0.4

0 commit comments

Comments
 (0)