From 4a6162ec54127bc08bfba818bed459ef030bc48e Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Fri, 12 Feb 2016 17:45:17 +0000 Subject: [PATCH] Set -Pmilestone automatically based on pom version --- mvnw | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mvnw b/mvnw index e351148..e9df15e 100755 --- a/mvnw +++ b/mvnw @@ -46,6 +46,15 @@ if [ -z "$MAVEN_SKIP_RC" ] ; then fi +VERSION=$(sed `dirname $0`/pom.xml -e '/\(.*\)<.*/\1/') +if echo $VERSION | egrep -q 'M|RC'; then + echo Activating \"milestone\" profile for version=\"$VERSION\" + echo $MAVEN_OPTS | grep -q milestone || MAVEN_OPTS="$MAVEN_OPTS -Pmilestone" +else + echo Deactivating \"milestone\" profile for version=\"$VERSION\" + echo $MAVEN_OPTS | grep -q milestone && MAVEN_OPTS=$(echo $MAVEN_OPTS | sed -e 's/-Pmilestone//') +fi + # OS specific support. $var _must_ be set to either true or false. cygwin=false; darwin=false;