An artifact repository which supports username/password authentication.
Type | Name and description |
---|---|
void |
credentials(Action<? super PasswordCredentials> action) Configures the username and password credentials for this repository using the supplied action. |
void |
credentials(Class<T> credentialsType, Action<? super T> action) Configures the credentials for this repository using the supplied action. |
PasswordCredentials |
getCredentials() Returns the username and password credentials used to authenticate to this repository. |
T |
getCredentials(Class<T> credentialsType) Returns the credentials of the specified type used to authenticate with this repository. |
Configures the username and password credentials for this repository using the supplied action.
If no credentials have been assigned to this repository, an empty set of username and password credentials is assigned to this repository and passed to the action.
repositories { maven { url "${url}" credentials { username = 'joe' password = 'secret' } } }
Configures the credentials for this repository using the supplied action.
If no credentials have been assigned to this repository, an empty set of credentials of the specified type will be assigned to this repository and given to the configuration action. If credentials have already been specified for this repository, they will be passed to the given configuration action.
repositories { maven { url "${url}" credentials(AwsCredentials) { accessKey "myAccessKey" secretKey "mySecret" } } }
The following credential types are currently supported for the credentialsType
argument:
credentialsType
is not of a supported typecredentialsType
is of a different type to the credentials previously specified for this repositoryReturns the username and password credentials used to authenticate to this repository.
If no credentials have been assigned to this repository, an empty set of username and password credentials is assigned to this repository and returned.
If you are using a different type of credentials than PasswordCredentials, please use getCredentials(Class) to obtain the credentials.
Returns the credentials of the specified type used to authenticate with this repository.
If no credentials have been assigned to this repository, an empty set of credentials of the specified type is assigned to this repository and returned.
credentialsType
- type of the credential