Collection<ArtifactRepository>, Configurable<ArtifactRepositoryContainer>, DomainObjectCollection<ArtifactRepository>, Iterable<ArtifactRepository>, List<ArtifactRepository>, NamedDomainObjectCollection<ArtifactRepository>, NamedDomainObjectList<ArtifactRepository>RepositoryHandlerpublic interface ArtifactRepositoryContainer extends NamedDomainObjectList<ArtifactRepository>, Configurable<ArtifactRepositoryContainer>
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 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'
}
| Modifier and Type | Field | Description |
|---|---|---|
static String |
DEFAULT_MAVEN_CENTRAL_REPO_NAME |
|
static String |
DEFAULT_MAVEN_LOCAL_REPO_NAME |
|
static String |
GOOGLE_URL |
|
static String |
MAVEN_CENTRAL_URL |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
add(ArtifactRepository repository) |
Adds a repository to this container, at the end of the repository sequence.
|
void |
addFirst(ArtifactRepository repository) |
Adds a repository to this container, at the start of the repository sequence.
|
void |
addLast(ArtifactRepository repository) |
Adds a repository to this container, at the end of the repository sequence.
|
ArtifactRepository |
getAt(String name) |
Locates an object by name, failing if there is no such object.
|
ArtifactRepository |
getByName(String name) |
Locates an object by name, failing if there is no such object.
|
ArtifactRepository |
getByName(String name,
Closure configureClosure) |
Locates an object by name, failing if there is no such object.
|
ArtifactRepository |
getByName(String name,
Action<? super ArtifactRepository> configureAction) |
Locates an object by name, failing if there is no such object.
|
parallelStream, removeIf, stream, toArrayconfigureaddAllLater, addLater, all, all, configureEach, whenObjectAdded, whenObjectAdded, whenObjectRemoved, whenObjectRemoved, withType, withTypeadd, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArrayaddAll, addRule, addRule, addRule, findByName, getAsMap, getCollectionSchema, getNamer, getNames, getRules, named, named, named, namedfindAll, matching, matching, withTypestatic final String DEFAULT_MAVEN_CENTRAL_REPO_NAME
static final String DEFAULT_MAVEN_LOCAL_REPO_NAME
static final String MAVEN_CENTRAL_URL
static final String GOOGLE_URL
boolean add(ArtifactRepository repository)
add in interface Collection<ArtifactRepository>add in interface List<ArtifactRepository>add in interface NamedDomainObjectCollection<ArtifactRepository>repository - The repository to add.true if the item was added, or false if an item with the same name already exists.void addFirst(ArtifactRepository repository)
repository - The repository to add.void addLast(ArtifactRepository repository)
repository - The repository to add.ArtifactRepository getByName(String name) throws UnknownRepositoryException
getByName in interface NamedDomainObjectCollection<ArtifactRepository>name - The object nameUnknownRepositoryExceptionArtifactRepository getByName(String name, Closure configureClosure) throws UnknownRepositoryException
getByName in interface NamedDomainObjectCollection<ArtifactRepository>name - The object nameconfigureClosure - The closure to use to configure the object.UnknownRepositoryExceptionArtifactRepository getByName(String name, Action<? super ArtifactRepository> configureAction) throws UnknownRepositoryException
getByName in interface NamedDomainObjectCollection<ArtifactRepository>name - The object nameconfigureAction - The action to use to configure the object.UnknownRepositoryExceptionArtifactRepository getAt(String name) throws UnknownRepositoryException
NamedDomainObjectCollection.getByName(String). You can call this method in your build script by using the groovy [] operator.getAt in interface NamedDomainObjectCollection<ArtifactRepository>name - The object nameUnknownRepositoryException