Skip to content
This repository has been archived by the owner on Dec 18, 2021. It is now read-only.

get MVNW_USERNAME and MVNW_PASSWORD from env #158

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/org/apache/maven/wrapper/DefaultDownloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ private void configureProxyAuthentication() {
}

private void configureAuthentication() {
if (System.getProperty("MVNW_USERNAME") != null && System.getProperty("MVNW_PASSWORD") != null && System.getProperty("http.proxyUser") == null) {
if (System.getenv(MVNW_USERNAME) != null && System.getenv(MVNW_PASSWORD) != null && System.getProperty("http.proxyUser") == null) {
Authenticator.setDefault(new Authenticator() {
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());
}
});
}
Expand Down