aboutsummaryrefslogtreecommitdiff
path: root/make-distribution.sh
diff options
context:
space:
mode:
authorRahul Singhal <rahul.singhal@guavus.com>2014-05-04 11:08:39 -0700
committerPatrick Wendell <pwendell@gmail.com>2014-05-04 11:08:39 -0700
commite97a2e6717e75c70c5474f2d211682565909e557 (patch)
treebf8c23e641dacc321a885154a64771949d518e33 /make-distribution.sh
parentfb0543224bcedb8ae3aab4a7ddcc6111a03378fe (diff)
downloadspark-e97a2e6717e75c70c5474f2d211682565909e557.tar.gz
spark-e97a2e6717e75c70c5474f2d211682565909e557.tar.bz2
spark-e97a2e6717e75c70c5474f2d211682565909e557.zip
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". Author: Rahul Singhal <rahul.singhal@guavus.com> Closes #580 from rahulsinghaliitd/SPARK-1658 and squashes the following commits: 83c0313 [Rahul Singhal] SPARK-1658: Correctly identify if maven is installed and working bf821b9 [Rahul Singhal] SPARK-1658: Correctly identify if maven is installed and working
Diffstat (limited to 'make-distribution.sh')
-rwxr-xr-xmake-distribution.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/make-distribution.sh b/make-distribution.sh
index c05dcd89d9..dc8aa56a2e 100755
--- a/make-distribution.sh
+++ b/make-distribution.sh
@@ -43,8 +43,9 @@
FWDIR="$(cd `dirname $0`; pwd)"
DISTDIR="$FWDIR/dist"
-VERSION=$(mvn help:evaluate -Dexpression=project.version | grep -v "INFO" | tail -n 1)
-if [ $? == -1 ] ;then
+set -o pipefail
+VERSION=$(mvn help:evaluate -Dexpression=project.version 2>/dev/null | grep -v "INFO" | tail -n 1)
+if [ $? != 0 ]; then
echo -e "You need Maven installed to build Spark."
echo -e "Download Maven from https://maven.apache.org."
exit -1;