3737@ echo off
3838@ REM set title of command window
3939title %0
40- @ REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
40+ @ REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
4141@ if " %MAVEN_BATCH_ECHO% " == " on" echo %MAVEN_BATCH_ECHO%
4242
4343@ REM set %HOME% to equivalent of $HOME
@@ -120,7 +120,7 @@ SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
120120set WRAPPER_JAR = " %MAVEN_PROJECTBASEDIR% \.mvn\wrapper\maven-wrapper.jar"
121121set WRAPPER_LAUNCHER = org.apache.maven.wrapper.MavenWrapperMain
122122
123- set DOWNLOAD_URL = " https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.3 /maven-wrapper-0.5.3 .jar"
123+ set DOWNLOAD_URL = " https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5 /maven-wrapper-0.5.5 .jar"
124124
125125FOR /F " tokens=1,2 delims==" %%A IN (" %MAVEN_PROJECTBASEDIR% \.mvn\wrapper\maven-wrapper.properties" ) DO (
126126 IF " %%A " == " wrapperUrl" SET DOWNLOAD_URL = %%B
@@ -129,25 +129,35 @@ FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-
129129@ REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
130130@ REM This allows using the maven wrapper in projects that prohibit checking in binary data.
131131if exist %WRAPPER_JAR% (
132- echo Found %WRAPPER_JAR%
132+ if " %MVNW_VERBOSE% " == " true" (
133+ echo Found %WRAPPER_JAR%
134+ )
133135) else (
134- if not " %MVNW_REPOURL% " == " " (
135- SET DOWNLOAD_URL = " %MVNW_REPOURL% /io/takari/maven-wrapper/0.5.3/maven-wrapper-0.5.3.jar"
136- )
137- echo Couldn't find %WRAPPER_JAR% , downloading it ...
138- echo Downloading from: %DOWNLOAD_URL%
139-
136+ if not " %MVNW_REPOURL% " == " " (
137+ SET DOWNLOAD_URL = " %MVNW_REPOURL% /io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
138+ )
139+ if " %MVNW_VERBOSE% " == " true" (
140+ echo Couldn't find %WRAPPER_JAR% , downloading it ...
141+ echo Downloading from: %DOWNLOAD_URL%
142+ )
143+
140144 powershell -Command " &{" ^
141145 " $webclient = new-object System.Net.WebClient;" ^
142146 " if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME% ') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD% '))) {" ^
143147 " $webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME% ', '%MVNW_PASSWORD% ');" ^
144148 " }" ^
145149 " [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL% ', '%WRAPPER_JAR% ')" ^
146150 " }"
147- echo Finished downloading %WRAPPER_JAR%
151+ if " %MVNW_VERBOSE% " == " true" (
152+ echo Finished downloading %WRAPPER_JAR%
153+ )
148154)
149155@ REM End of extension
150156
157+ @ REM Provide a "standardized" way to retrieve the CLI args that will
158+ @ REM work with both Windows and non-Windows executions.
159+ set MAVEN_CMD_LINE_ARGS = %*
160+
151161%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% " -Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR% " %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
152162if ERRORLEVEL 1 goto error
153163goto end
0 commit comments