From 66f795476bc7c9f5c21f4a337fbdc1c39c7fd0c6 Mon Sep 17 00:00:00 2001 From: rfscholte Date: Wed, 27 May 2020 22:57:34 +0200 Subject: [PATCH] [MNG-6919] drop wrapperUrl from maven-wrapper.properties Ensure maven-wrapper can handle spaced paths --- apache-maven/maven-wrapper.pom | 2 +- apache-maven/src/assembly/shared/run | 2 +- apache-maven/src/assembly/wrapper/script/download | 4 ---- apache-maven/src/assembly/wrapper/script/download.cmd | 4 ---- .../wrapper/shared/.mvn/wrapper/maven-wrapper.properties | 1 - apache-maven/src/assembly/wrapper/source/download.cmd | 4 ++-- 6 files changed, 4 insertions(+), 13 deletions(-) diff --git a/apache-maven/maven-wrapper.pom b/apache-maven/maven-wrapper.pom index 455e3a6bc7..f2bcc7fc14 100644 --- a/apache-maven/maven-wrapper.pom +++ b/apache-maven/maven-wrapper.pom @@ -81,7 +81,7 @@ under the License. - src/assembly/wrapper//script.xml + src/assembly/wrapper/script.xml src/assembly/wrapper/bin.xml src/assembly/wrapper/source.xml diff --git a/apache-maven/src/assembly/shared/run b/apache-maven/src/assembly/shared/run index 90be6d379b..7aa3f55dc6 100755 --- a/apache-maven/src/assembly/shared/run +++ b/apache-maven/src/assembly/shared/run @@ -17,6 +17,6 @@ export MAVEN_CMD_LINE_ARGS exec "$JAVACMD" \ $MAVEN_OPTS \ - -classpath ${LAUNCHER_JAR} \ + -classpath "${LAUNCHER_JAR}" \ $MAVENHOME_CONFIG "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ $MAVEN_LAUNCHER "$@" diff --git a/apache-maven/src/assembly/wrapper/script/download b/apache-maven/src/assembly/wrapper/script/download index 2d08207e75..e2a011c249 100755 --- a/apache-maven/src/assembly/wrapper/script/download +++ b/apache-maven/src/assembly/wrapper/script/download @@ -12,10 +12,6 @@ else fi jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/maven-wrapper/${project.version}/maven-wrapper-${project.version}.jar" - while IFS="=" read key value; do - case "$key" in (wrapperUrl) jarUrl="$value"; break ;; - esac - done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" if [ -n "$MVNW_REPOURL" ]; then jarUrl="$MVNW_REPOURL/org/apache/maven/maven-wrapper/${project.version}/maven-wrapper-${project.version}.jar" diff --git a/apache-maven/src/assembly/wrapper/script/download.cmd b/apache-maven/src/assembly/wrapper/script/download.cmd index 998dda52e1..8d71146cd2 100755 --- a/apache-maven/src/assembly/wrapper/script/download.cmd +++ b/apache-maven/src/assembly/wrapper/script/download.cmd @@ -8,10 +8,6 @@ goto endWrapper :downloadWrapper set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/maven-wrapper/${project.version}/maven-wrapper-${project.version}.jar" -FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( - IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B -) - if not "%MVNW_REPOURL%" == "" ( SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/maven-wrapper/${project.version}/maven-wrapper-${project.version}.jar" ) diff --git a/apache-maven/src/assembly/wrapper/shared/.mvn/wrapper/maven-wrapper.properties b/apache-maven/src/assembly/wrapper/shared/.mvn/wrapper/maven-wrapper.properties index a2987ea558..6e5352356a 100644 --- a/apache-maven/src/assembly/wrapper/shared/.mvn/wrapper/maven-wrapper.properties +++ b/apache-maven/src/assembly/wrapper/shared/.mvn/wrapper/maven-wrapper.properties @@ -15,4 +15,3 @@ # specific language governing permissions and limitations # under the License. distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/${project.version}/apache-maven-${project.version}-bin.zip -wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/maven-wrapper/${project.version}/maven-wrapper-${project.version}.jar diff --git a/apache-maven/src/assembly/wrapper/source/download.cmd b/apache-maven/src/assembly/wrapper/source/download.cmd index 28d134949e..40d8451ae4 100644 --- a/apache-maven/src/assembly/wrapper/source/download.cmd +++ b/apache-maven/src/assembly/wrapper/source/download.cmd @@ -1,7 +1,7 @@ @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central @REM This allows using the maven wrapper in projects that prohibit checking in binary data. -SET javaClass=%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\MavenWrapperDownloader.java +SET javaClass="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\MavenWrapperDownloader.java" IF EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\MavenDownloader.class" goto :runDownloader if "%MVNW_VERBOSE%" == "true" echo - Compiling MavenWrapperDownloader.java ... @@ -14,7 +14,7 @@ IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\MavenWrapperDownloader.class" if "%MVNW_VERBOSE%" == "true" echo - Running MavenWrapperDownloader.class ... @REM Running the downloader -"%JAVA_HOME%\bin\java" -cp .mvn\wrapper MavenWrapperDownloader "%MAVEN_PROJECTBASEDIR%" +"%JAVA_HOME%\bin\java" -cp "%MAVEN_PROJECTBASEDIR%\.mvn\wrapper" MavenWrapperDownloader "%MAVEN_PROJECTBASEDIR%" :endWrapper @REM End of extension