From 70e5171270b21ca650ef17eb86c8f12ddf5aa81d Mon Sep 17 00:00:00 2001 From: Christofer Dutz Date: Fri, 14 Jul 2017 14:25:26 +0200 Subject: [PATCH] - Added a download extension for windows --- maven-wrapper/mvnw | 2 -- maven-wrapper/mvnw.cmd | 11 +++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/maven-wrapper/mvnw b/maven-wrapper/mvnw index 9b4e98ecea..b8464e939f 100755 --- a/maven-wrapper/mvnw +++ b/maven-wrapper/mvnw @@ -204,7 +204,6 @@ fi # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central # This allows using the maven wrapper in projects that prohibit checking in binary data. ########################################################################################## - JAR_URL="http://central.maven.org/maven2/io/takari/maven-wrapper/0.2.1/maven-wrapper-0.2.1.jar" if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then echo "Found .mvn/wrapper/maven-wrapper.jar" @@ -233,7 +232,6 @@ else fi fi fi - ########################################################################################## # End of extension ########################################################################################## diff --git a/maven-wrapper/mvnw.cmd b/maven-wrapper/mvnw.cmd index 4f0b068a03..b3bd9faa41 100644 --- a/maven-wrapper/mvnw.cmd +++ b/maven-wrapper/mvnw.cmd @@ -121,6 +121,17 @@ SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain +@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 .mvn/wrapper/maven-wrapper.jar ( + echo Found .mvn/wrapper/maven-wrapper.jar +) else ( + echo Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ... + powershell -Command "(New-Object Net.WebClient).DownloadFile('http://central.maven.org/maven2/io/takari/maven-wrapper/0.2.1/maven-wrapper-0.2.1.jar', '.mvn/wrapper/maven-wrapper.jar')" + echo Finished downloading .mvn/wrapper/maven-wrapper.jar +) +@REM End of extension + %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* if ERRORLEVEL 1 goto error goto end