From 25f27fc501e7730619f7c36246d44d15f4ec93f2 Mon Sep 17 00:00:00 2001 From: Christofer Dutz Date: Sun, 23 Jul 2017 14:50:29 +0200 Subject: [PATCH] Fixed the windows version of the script --- maven-wrapper/mvnw.cmd | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/maven-wrapper/mvnw.cmd b/maven-wrapper/mvnw.cmd index 9aa55a5e1c..78b6ff68e6 100644 --- a/maven-wrapper/mvnw.cmd +++ b/maven-wrapper/mvnw.cmd @@ -117,24 +117,23 @@ for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do s :endReadAdditionalConfig SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" - -set DOWNLOAD_URL="http://central.maven.org/maven2/io/takari/maven-wrapper/0.2.1/maven-wrapper-0.2.1.jar" -FOR /F "tokens=3,* delims=.=" %%G IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( set %%G=%%H ) - if "%%G"=="wrapperUrl" - set DOWNLOAD_URL=%%H -echo Downloading from: "%DOWNLOAD_URL%" - set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain +set DOWNLOAD_URL="http://central.maven.org/maven2/io/takari/maven-wrapper/0.2.1/maven-wrapper-0.2.1.jar" +FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + @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. -if exist %WRAPPER_JAR%" ( - echo Found %WRAPPER_JAR%" +if exist %WRAPPER_JAR% ( + echo Found %WRAPPER_JAR% ) else ( - echo Couldn't find %WRAPPER_JAR%", downloading it ... + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')" - echo Finished downloading %WRAPPER_JAR%" + echo Finished downloading %WRAPPER_JAR% ) @REM End of extension