get MVNW_USERNAME and MVNW_PASSWORD from env

when auth for the http proxy, MVNW_{USERNAME,PASSWORD} should be fetched via `System.getenv`.
This commit is contained in:
James Z.M. Gao 2020-05-24 22:36:14 +08:00 committed by rfscholte
parent c6c7311713
commit fe3b2dcb8a
1 changed files with 3 additions and 3 deletions

View File

@ -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() );
}
} );
}