Skip to content

Commit 2b0a5e9

Browse files
Updating mvnw for all projects
1 parent e13764d commit 2b0a5e9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

mvnw

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,21 @@ export MAVEN_CMD_LINE_ARGS
226226

227227
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
228228

229+
echo "Running version check for the first time to ensure all jars are downloaded. Without this wrong version might be chosen"
229230
VERSION=$(exec "$JAVACMD" \
230231
$MAVEN_OPTS \
231232
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
232233
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
233234
-Dexec.executable="echo" -Dexec.args='${project.version}' ${WRAPPER_LAUNCHER} -q --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec )
234235

236+
echo "Running version check for the second time in order to output only the version"
237+
VERSION=$(exec "$JAVACMD" \
238+
$MAVEN_OPTS \
239+
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
240+
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
241+
-Dexec.executable="echo" -Dexec.args='${project.version}' ${WRAPPER_LAUNCHER} -q --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec )
242+
echo "The found version is [${VERSION}]"
243+
235244
if echo $VERSION | egrep -q 'M|RC'; then
236245
echo Activating \"milestone\" profile for version=\"$VERSION\"
237246
echo $MAVEN_ARGS | grep -q milestone || MAVEN_ARGS="$MAVEN_ARGS -Pmilestone"

0 commit comments

Comments
 (0)