File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -291,5 +291,26 @@ verbose "Found extracted Maven distribution directory: $actualDistributionDir"
291291printf %s\\ n " $distributionUrl " > " $TMP_DOWNLOAD_DIR /$actualDistributionDir /mvnw.url"
292292mv -- " $TMP_DOWNLOAD_DIR /$actualDistributionDir " " $MAVEN_HOME " || [ -d " $MAVEN_HOME " ] || die " fail to move MAVEN_HOME"
293293
294+ echo " Running version check"
295+ VERSION=$( sed ' \!<parent!,\!</parent!d' ` dirname $0 ` /pom.xml | grep ' <version' | head -1 | sed -e ' s/.*<version>//' -e ' s!</version>.*$!!' )
296+ echo " The found version is [${VERSION} ]"
297+
298+ MAVEN_ARGS=${MAVEN_ARGS:- }
299+ if echo $VERSION | egrep -q ' M|RC' ; then
300+ echo Activating \" milestone\" profile for version=\" $VERSION \"
301+ echo $MAVEN_ARGS | grep -q milestone || MAVEN_ARGS=" $MAVEN_ARGS -Pmilestone"
302+ else
303+ echo Deactivating \" milestone\" profile for version=\" $VERSION \"
304+ echo $MAVEN_ARGS | grep -q milestone && MAVEN_ARGS=$( echo $MAVEN_ARGS | sed -e ' s/-Pmilestone//' )
305+ fi
306+
307+ if echo $VERSION | egrep -q ' [0-9]*\.[0-9]*\.[0-9]*$|RELEASE' ; then
308+ echo Activating \" central\" profile for version=\" $VERSION \"
309+ echo $MAVEN_ARGS | grep -q milestone || MAVEN_ARGS=" $MAVEN_ARGS -Pcentral"
310+ else
311+ echo Deactivating \" central\" profile for version=\" $VERSION \"
312+ echo $MAVEN_ARGS | grep -q central && MAVEN_ARGS=$( echo $MAVEN_ARGS | sed -e ' s/-Pcentral//' )
313+ fi
314+
294315clean || :
295- exec_maven " $@ "
316+ exec_maven $MAVEN_ARGS " $@ "
You can’t perform that action at this time.
0 commit comments