mirror of https://github.com/apache/maven.git
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:
parent
c6c7311713
commit
fe3b2dcb8a
|
@ -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() );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue