diff --git a/maven-wrapper/src/main/java/org/apache/maven/wrapper/DefaultDownloader.java b/maven-wrapper/src/main/java/org/apache/maven/wrapper/DefaultDownloader.java index 943189bfca..61957239e4 100644 --- a/maven-wrapper/src/main/java/org/apache/maven/wrapper/DefaultDownloader.java +++ b/maven-wrapper/src/main/java/org/apache/maven/wrapper/DefaultDownloader.java @@ -68,7 +68,7 @@ private void configureProxyAuthentication() private void configureAuthentication() { - if ( System.getProperty( "MVNW_USERNAME" ) != null && System.getProperty( "MVNW_PASSWORD" ) != null + if ( System.getenv( MVNW_USERNAME ) != null && System.getenv( MVNW_PASSWORD ) != null && System.getProperty( "http.proxyUser" ) == null ) { Authenticator.setDefault( new Authenticator() @@ -76,8 +76,8 @@ private void configureAuthentication() @Override protected PasswordAuthentication getPasswordAuthentication() { - return new PasswordAuthentication( System.getProperty( "MVNW_USERNAME" ), - System.getProperty( "MVNW_PASSWORD" ).toCharArray() ); + return new PasswordAuthentication( System.getenv( MVNW_USERNAME ), + System.getenv( MVNW_PASSWORD ).toCharArray() ); } } ); }