This commit is contained in:
Daan Hoogland 2015-02-21 13:12:18 +01:00
commit b3281eef15
1 changed files with 9 additions and 2 deletions

View File

@ -48,8 +48,15 @@ function packaging() {
fi
DISTRO=$3
VERSION=`(cd ../; mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version) | grep --color=none '^[0-9]\.'`
MVN=`which mvn`
if [ -z "$MVN" ] ; then
MVN=`locate bin/mvn | grep -e mvn$ | tail -1`
if [ -z "$MVN" ] ; then
echo "mvn not found\n cannot retrieve version to package\n RPM Build Failed"
exit 2
fi
fi
VERSION=`(cd ../; $MVN org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version) | grep --color=none '^[0-9]\.'`
if echo $VERSION | grep -q SNAPSHOT ; then
REALVER=`echo $VERSION | cut -d '-' -f 1`
DEFVER="-D_ver $REALVER"