Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Commit

Permalink
Added realm parameter for credentials (fix for #29)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhendess authored and ysb33r committed May 8, 2019
1 parent ad7d06f commit fe6a76a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,11 @@ class OfflineRepositorySync extends DefaultTask {
this.repositories.each {
if (it.metaClass.respondsTo(it, 'getCredentials')) {
if (it.credentials.username && it.credentials.password) {
xml += "<credentials host='${it.url.host}' username='${it.credentials.username}' passwd='${it.credentials.password}'/>"
xml += "<credentials host='${it.url.host}' username='${it.credentials.username}' passwd='${it.credentials.password}' "
if (it.credentials.realm) {
xml += "realm='${it.credentials.realm}' "
}
xml += "/>"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ import org.gradle.api.artifacts.repositories.PasswordCredentials
class Credentials implements PasswordCredentials {
String username
String password
String realm

void username(final String s) {this.username=s}
void password(final String s) {this.password=s}
void realm(final String s) {this.realm=s}
}

0 comments on commit fe6a76a

Please sign in to comment.