monasca-common/run_maven.sh
Craig Bryant 92254990bc Fail main maven build if java maven build fails
Java maven sub build could fail and main maven build still
succeed because of the shell script in between. Pass the maven
exit code back

Change-Id: I4df4ee7d782db21c89c49b0ee0a4741cbfa97edb
2015-02-19 12:53:22 -07:00

25 lines
623 B
Bash
Executable File

#!/bin/bash
# Download maven 3 if the system maven isn't maven 3
VERSION=`mvn -v | grep "Apache Maven 3"`
if [ -z "${VERSION}" ]; then
curl http://archive.apache.org/dist/maven/binaries/apache-maven-3.2.1-bin.tar.gz > apache-maven-3.2.1-bin.tar.gz
tar -xvzf apache-maven-3.2.1-bin.tar.gz
MVN=${PWD}/apache-maven-3.2.1/bin/mvn
else
MVN=mvn
fi
# Get rid of the java property name containing the args
shift
# Invoke the maven 3 on the real pom.xml
( cd java; ${MVN} $* )
RC=$?
# Copy the jars where the publisher will find them
mkdir -p target
cp java/*/target/*.jar target
rm -fr apache-maven-3.2.1*
exit $RC