api / org.gradle.api.artifacts / ArtifactRepositoryContainer

ArtifactRepositoryContainer

interface ArtifactRepositoryContainer : NamedDomainObjectList<ArtifactRepository>, Configurable

A ResolverContainer is responsible for managing a set of ArtifactRepository instances. Repositories are arranged in a sequence.

You can obtain a ResolverContainer instance by calling org.gradle.api.Project#getRepositories() or using the repositories property in your build script.

The resolvers in a container are accessible as read-only properties of the container, using the name of the resolver as the property name. For example:

 repositories.maven { name 'myResolver' } repositories.myResolver.url = 'some-url' 

A dynamic method is added for each resolver which takes a configuration closure. This is equivalent to calling #getByName(String, groovy.lang.Closure). For example:

 repositories.maven { name 'myResolver' } repositories.myResolver { url 'some-url' } 

Properties

DEFAULT_MAVEN_CENTRAL_REPO_NAME

static val DEFAULT_MAVEN_CENTRAL_REPO_NAME: String

DEFAULT_MAVEN_LOCAL_REPO_NAME

static val DEFAULT_MAVEN_LOCAL_REPO_NAME: String

GOOGLE_URL

static val GOOGLE_URL: String

MAVEN_CENTRAL_URL

static val MAVEN_CENTRAL_URL: String

Functions

add

abstract fun add(element: ArtifactRepository): Boolean

Adds a repository to this container, at the end of the repository sequence.

addFirst

abstract fun addFirst(repository: ArtifactRepository): Unit

Adds a repository to this container, at the start of the repository sequence.

addLast

abstract fun addLast(repository: ArtifactRepository): Unit

Adds a repository to this container, at the end of the repository sequence.

getAt

abstract fun getAt(name: String): ArtifactRepository

{@inheritDoc}

getByName

abstract fun getByName(name: String): ArtifactRepository
abstract fun getByName(name: String, configureClosure: Closure<Any>): ArtifactRepository
abstract fun getByName(name: String, configureAction: Action<in ArtifactRepository>): ArtifactRepository

{@inheritDoc}

Inherited Functions

findAll

abstract fun findAll(spec: Closure<Any>): MutableList<T>

{@inheritDoc}

matching

abstract fun matching(spec: Spec<in T>): NamedDomainObjectList<T>
abstract fun matching(spec: Closure<Any>): NamedDomainObjectList<T>

{@inheritDoc}

withType

abstract fun <S : T> withType(type: Class<S>): NamedDomainObjectList<S>

{@inheritDoc}

Inheritors

RepositoryHandler

interface RepositoryHandler : ArtifactRepositoryContainer

A RepositoryHandler manages a set of repositories, allowing repositories to be defined and queried.