You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2020/05/24 15:48:52 UTC

[maven] branch MNG-6918 created (now fe3b2dc)

This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a change to branch MNG-6918
in repository https://gitbox.apache.org/repos/asf/maven.git.


      at fe3b2dc  get MVNW_USERNAME and MVNW_PASSWORD from env

This branch includes the following new commits:

     new fe3b2dc  get MVNW_USERNAME and MVNW_PASSWORD from env

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven] 01/01: get MVNW_USERNAME and MVNW_PASSWORD from env

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-6918
in repository https://gitbox.apache.org/repos/asf/maven.git

commit fe3b2dcb8ac2a84993cf193c576a49891e883a7e
Author: James Z.M. Gao <ga...@360.cn>
AuthorDate: Sun May 24 22:36:14 2020 +0800

    get MVNW_USERNAME and MVNW_PASSWORD from env
    
    when auth for the http proxy, MVNW_{USERNAME,PASSWORD} should be fetched via `System.getenv`.
---
 .../src/main/java/org/apache/maven/wrapper/DefaultDownloader.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

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 943189b..6195723 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 @@ public class DefaultDownloader
 
     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 @@ public class DefaultDownloader
                 @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() );
                 }
             } );
         }