Table of Contents
API Documentation: | AuthenticationSupported |
---|
Known Subtypes: |
|
---|
An artifact repository which supports username/password authentication.
Property | Description |
authentication | The authentication schemes for this repository. |
credentials | The credentials of the specified type used to authenticate with this repository. |
Method | Description |
authentication(action) | Configures the authentication schemes for this repository. |
credentials(credentialsType) | Configures the credentials for this repository that will be provided by the build. |
credentials(credentialsType, action) | Configures the credentials for this repository using the supplied action. |
credentials(action) | Configures the username and password credentials for this repository using the supplied action. |
AuthenticationContainer
authentication
(read-only)
The authentication schemes for this repository.
void
authentication
(Action
<? super AuthenticationContainer
>
action)
Action
<? super AuthenticationContainer
>Configures the authentication schemes for this repository.
This method executes the given action against the AuthenticationContainer
for this project. The AuthenticationContainer
is passed to the closure as the closure's delegate.
If no authentication schemes have been assigned to this repository, a default set of authentication schemes are used based on the repository's transport scheme.
repositories {
maven {
url = "https://example.com/m2"
authentication {
basic(BasicAuthentication)
}
}
}
Supported authentication scheme types extend Authentication
.
void
credentials
(Class
<? extends Credentials
>
credentialsType)
Class
<? extends Credentials
>Configures the credentials for this repository that will be provided by the build.
Credentials will be provided from Gradle properties based on the repository name. If credentials for this repository can not be resolved and the repository will be used in the current build, then the build will fail to start and point to the missing configuration.
repositories {
maven {
url = "https://example.com/m2"
credentials(PasswordCredentials)
}
}
The following credential types are currently supported for the credentialsType
argument:
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 = "https://example.com/aws/proxy" credentials(AwsCredentials) { accessKey = "myAccessKey" secretKey = "mySecret" } } }
The following credential types are currently supported for the credentialsType
argument:
void
credentials
(Action
<? super PasswordCredentials
>
action)
Action
<? super PasswordCredentials
>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 = "https://example.com/m2" credentials { username = 'joe' password = 'secret' } } }