File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -291,5 +291,25 @@ 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+ if echo $VERSION | egrep -q ' M|RC' ; then
299+ echo Activating \" milestone\" profile for version=\" $VERSION \"
300+ echo $MAVEN_ARGS | grep -q milestone || MAVEN_ARGS=" $MAVEN_ARGS -Pmilestone"
301+ else
302+ echo Deactivating \" milestone\" profile for version=\" $VERSION \"
303+ echo $MAVEN_ARGS | grep -q milestone && MAVEN_ARGS=$( echo $MAVEN_ARGS | sed -e ' s/-Pmilestone//' )
304+ fi
305+
306+ if echo $VERSION | egrep -q ' [0-9]*\.[0-9]*\.[0-9]*$|RELEASE' ; then
307+ echo Activating \" central\" profile for version=\" $VERSION \"
308+ echo $MAVEN_ARGS | grep -q milestone || MAVEN_ARGS=" $MAVEN_ARGS -Pcentral"
309+ else
310+ echo Deactivating \" central\" profile for version=\" $VERSION \"
311+ echo $MAVEN_ARGS | grep -q central && MAVEN_ARGS=$( echo $MAVEN_ARGS | sed -e ' s/-Pcentral//' )
312+ fi
313+
294314clean || :
295- exec_maven " $@ "
315+ exec_maven " $MAVEN_ARGS " " $ @"
You can’t perform that action at this time.
0 commit comments