File tree Expand file tree Collapse file tree 3 files changed +20
-20
lines changed
maven-wrapper-distribution/src/resources Expand file tree Collapse file tree 3 files changed +20
-20
lines changed Original file line number Diff line number Diff line change @@ -141,12 +141,12 @@ if exist %WRAPPER_JAR% (
141141 )
142142
143143 powershell -Command " &{" ^
144- " $webclient = new-object System.Net.WebClient;" ^
145- " if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME% ') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD% '))) {" ^
146- " $webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME% ', '%MVNW_PASSWORD% ');" ^
147- " }" ^
148- " [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL% ', '%WRAPPER_JAR% ')" ^
149- " }"
144+ " $webclient = new-object System.Net.WebClient;" ^
145+ " if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME% ') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD% '))) {" ^
146+ " $webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME% ', '%MVNW_PASSWORD% ');" ^
147+ " }" ^
148+ " [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL% ', '%WRAPPER_JAR% ')" ^
149+ " }"
150150 if " %MVNW_VERBOSE% " == " true" (
151151 echo Finished downloading %WRAPPER_JAR%
152152 )
Original file line number Diff line number Diff line change @@ -202,19 +202,19 @@ elif set_java_home; then
202202 javaSource=" $TMP_DOWNLOAD_DIR /Downloader.java"
203203 targetZip=" $TMP_DOWNLOAD_DIR /$distributionUrlName "
204204 cat > " $javaSource " << -END
205- public class Downloader extends java.net.Authenticator
206- {
207- protected java.net.PasswordAuthentication getPasswordAuthentication()
208- {
209- return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
210- }
211- public static void main( String[] args ) throws Exception
212- {
213- setDefault( new Downloader() );
214- java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
215- }
216- }
217- END
205+ public class Downloader extends java.net.Authenticator
206+ {
207+ protected java.net.PasswordAuthentication getPasswordAuthentication()
208+ {
209+ return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
210+ }
211+ public static void main( String[] args ) throws Exception
212+ {
213+ setDefault( new Downloader() );
214+ java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
215+ }
216+ }
217+ END
218218 # For Cygwin/MinGW, switch paths to Windows format before running javac and java
219219 verbose " - Compiling Downloader.java ..."
220220 "$( native_path " $JAVACCMD " ) " "$( native_path " $javaSource " ) " || die "Failed to compile Downloader.java"
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ at an easier glance.
5151 - fixes https://github.com/takari/maven-wrapper/issues/109
5252 - see https://github.com/takari/maven-wrapper/pull/111
5353 - contributed by Piotrek Żygieło https://github.com/pzygielo and
54- Sebastian Peters https://github.com/sepe81,
54+ Sebastian Peters https://github.com/sepe81 ,
5555
5656Release performed by Manfred Moser - http://www.simpligility.com
5757
You can’t perform that action at this time.
0 commit comments