Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD

## org.gradle.api.artifacts
[Java] Interface ArtifactRepositoryContainer

    java.lang.Iterable
      org.gradle.api.NamedDomainObjectCollection
          org.gradle.api.DomainObjectCollection
              org.gradle.api.artifacts.ArtifactRepositoryContainer
                  org.gradle.api.NamedDomainObjectList
                      java.util.Collection
                          org.gradle.util.Configurable

All Superinterfaces:
  Iterable, NamedDomainObjectCollection, DomainObjectCollection, NamedDomainObjectList, Collection, Configurable

    public interface ArtifactRepositoryContainer
    extends Configurable, NamedDomainObjectList

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'
     }

Field Summary
`String` | `DEFAULT_CACHE_ARTIFACT_PATTERN`
`String` | `DEFAULT_CACHE_IVY_PATTERN`
`String` | `DEFAULT_MAVEN_CENTRAL_REPO_NAME`
`String` | `DEFAULT_MAVEN_LOCAL_REPO_NAME`
`String` | `INTERNAL_REPOSITORY_NAME`
`String` | `MAVEN_CENTRAL_URL`
`String` | `MAVEN_REPO_PATTERN`
`String` | `RESOLVER_NAME`
`String` | `RESOLVER_URL`

Method Summary
`boolean` | `add(ArtifactRepository repository)` Adds a repository to this container, at the end of the repository sequence.
`boolean` | `add(DependencyResolver resolver)` Adds a repository to this container, at the end of the repository sequence.
`boolean` | `add(DependencyResolver resolver, Closure configureClosure)` Adds a repository to this container, at the end of the repository sequence.
`DependencyResolver` | `addAfter(Object userDescription, String previousResolver)` Adds a resolver to this container, after the given resolver.
`DependencyResolver` | `addAfter(Object userDescription, String previousResolver, Closure configureClosure)` Adds a resolver to this container, after the given resolver.
`DependencyResolver` | `addBefore(Object userDescription, String nextResolver)` Adds a resolver to this container, before the given resolver.
`DependencyResolver` | `addBefore(Object userDescription, String nextResolver, Closure configureClosure)` Adds a resolver to this container, before the given resolver.
`void` | `addFirst(ArtifactRepository repository)` Adds a repository to this container, at the start of the repository sequence.
`DependencyResolver` | `addFirst(Object userDescription)` Adds a resolver to this container, at the start of the resolver sequence.
`DependencyResolver` | `addFirst(Object userDescription, Closure configureClosure)` Adds a resolver to this container, at the start of the resolver sequence.
`void` | `addLast(ArtifactRepository repository)` Adds a repository to this container, at the end of the repository sequence.
`DependencyResolver` | `addLast(Object userDescription)` Adds a repository to this container, at the end of the repository sequence.
`DependencyResolver` | `addLast(Object userDescription, Closure configureClosure)` Adds a resolver to this container, at the end of the resolver sequence.
`ArtifactRepository` | `getAt(String name)` {@inheritDoc}
`ArtifactRepository` | `getByName(String name)` {@inheritDoc}
`ArtifactRepository` | `getByName(String name, Closure configureClosure)` {@inheritDoc}
`List` | `getResolvers()` Returns the resolvers in this container, in sequence.

Methods inherited from interface NamedDomainObjectList
findAll, matching, matching, withType

Field Detail

### DEFAULT_CACHE_ARTIFACT_PATTERN

    @Deprecated
    public String DEFAULT_CACHE_ARTIFACT_PATTERN

### DEFAULT_CACHE_IVY_PATTERN

    @Deprecated
    public String DEFAULT_CACHE_IVY_PATTERN

### DEFAULT_MAVEN_CENTRAL_REPO_NAME

    public String DEFAULT_MAVEN_CENTRAL_REPO_NAME

### DEFAULT_MAVEN_LOCAL_REPO_NAME

    public String DEFAULT_MAVEN_LOCAL_REPO_NAME

### INTERNAL_REPOSITORY_NAME

    @Deprecated
    public String INTERNAL_REPOSITORY_NAME

### MAVEN_CENTRAL_URL

    public String MAVEN_CENTRAL_URL

### MAVEN_REPO_PATTERN

    @Deprecated
    public String MAVEN_REPO_PATTERN

### RESOLVER_NAME

    @Deprecated
    public String RESOLVER_NAME

### RESOLVER_URL

    @Deprecated
    public String RESOLVER_URL

Method Detail

### add

    public boolean add(ArtifactRepository repository)

  Adds a repository to this container, at the end of the repository sequence.
  Parameters:
    `repository` - The repository to add.

### add

    @Deprecated
    public boolean add(DependencyResolver resolver)

  Adds a repository to this container, at the end of the repository sequence.
  deprecated:
    Use one of the repository methods on RepositoryHandler or add(ArtifactRepository) instead.
  Parameters:
    `resolver` - The repository to add, represented as an Ivy DependencyResolver.

### add

    @Deprecated
    public boolean add(DependencyResolver resolver, Closure configureClosure)

  Adds a repository to this container, at the end of the repository sequence.
  deprecated:
    Use one of the repository methods on RepositoryHandler or add(ArtifactRepository) instead.
  Parameters:
    `resolver` - The repository to add, represented as an Ivy DependencyResolver.
    `configureClosure` - The closure to use to configure the repository.

### addAfter

    @Deprecated
    public DependencyResolver addAfter(Object userDescription, String previousResolver)

  Adds a resolver to this container, after the given resolver.
  throws:
    InvalidUserDataException when a resolver with the given name already exists in this container.
  throws:
    UnknownRepositoryException when the given previous resolver does not exist in this container.
  deprecated:
    No replacement
  Parameters:
    `userDescription` - The resolver definition. See addLast(Object) for details of this parameter.
    `previousResolver` - The existing resolver to add the new resolver after.
  Returns:
    The added resolver.

### addAfter

    @Deprecated
    public DependencyResolver addAfter(Object userDescription, String previousResolver, Closure configureClosure)

  Adds a resolver to this container, after the given resolver. The resolver is configured using the given configure closure.
  throws:
    InvalidUserDataException when a resolver with the given name already exists in this container.
  throws:
    UnknownRepositoryException when the given previous resolver does not exist in this container.
  deprecated:
    No replacement
  Parameters:
    `userDescription` - The resolver definition. See addLast(Object) for details of this parameter.
    `previousResolver` - The existing resolver to add the new resolver after.
    `configureClosure` - The closure to use to configure the resolver.
  Returns:
    The added resolver.

### addBefore

    @Deprecated
    public DependencyResolver addBefore(Object userDescription, String nextResolver)

  Adds a resolver to this container, before the given resolver.
  throws:
    InvalidUserDataException when a resolver with the given name already exists in this container.
  throws:
    UnknownRepositoryException when the given next resolver does not exist in this container.
  deprecated:
    No replacement
  Parameters:
    `userDescription` - The resolver definition. See addLast(Object) for details of this parameter.
    `nextResolver` - The existing resolver to add the new resolver before.
  Returns:
    The added resolver.

### addBefore

    @Deprecated
    public DependencyResolver addBefore(Object userDescription, String nextResolver, Closure configureClosure)

  Adds a resolver to this container, before the given resolver. The resolver is configured using the given configure closure.
  throws:
    InvalidUserDataException when a resolver with the given name already exists in this container.
  throws:
    UnknownRepositoryException when the given next resolver does not exist in this container.
  deprecated:
    No replacement
  Parameters:
    `userDescription` - The resolver definition. See addLast(Object) for details of this parameter.
    `nextResolver` - The existing resolver to add the new resolver before.
    `configureClosure` - The closure to use to configure the resolver.
  Returns:
    The added resolver.

### addFirst

    public void addFirst(ArtifactRepository repository)

  Adds a repository to this container, at the start of the repository sequence.
  Parameters:
    `repository` - The repository to add.

### addFirst

    @Deprecated
    public DependencyResolver addFirst(Object userDescription)

  Adds a resolver to this container, at the start of the resolver sequence.
  throws:
    InvalidUserDataException when a resolver with the given name already exists in this container.
  deprecated:
    Use addFirst(ArtifactRepository) instead.
  Parameters:
    `userDescription` - The resolver definition. See addLast(Object) for details of this parameter.
  Returns:
    The added resolver.

### addFirst

    @Deprecated
    public DependencyResolver addFirst(Object userDescription, Closure configureClosure)

  Adds a resolver to this container, at the start of the resolver sequence. The resolver is configured using the given configure closure.
  throws:
    InvalidUserDataException when a resolver with the given name already exists in this container.
  deprecated:
    Use addFirst(ArtifactRepository) instead.
  Parameters:
    `userDescription` - The resolver definition. See addLast(Object) for details of this parameter.
    `configureClosure` - The closure to use to configure the resolver.
  Returns:
    The added resolver.

### addLast

    public void addLast(ArtifactRepository repository)

  Adds a repository to this container, at the end of the repository sequence.
  Parameters:
    `repository` - The repository to add.

### addLast

    @Deprecated
    public DependencyResolver addLast(Object userDescription)

  Adds a repository to this container, at the end of the repository sequence. The given `userDescription` can be one of:
  - A String. This is treated as a URL, and used to create a Maven repository.
  - A map. This is used to create a Maven repository. The map must contain an {
    value:
      #RESOLVER_NAME} entry and a {@value #RESOLVER_URL} entry.
  - A DependencyResolver.
  - A ArtifactRepository.

throws:
  InvalidUserDataException when a resolver with the given name already exists in this container.

deprecated:
  Use RepositoryHandler.maven or add(ArtifactRepository) instead.

Parameters:
  `userDescription` - The resolver definition.

Returns:
  The added resolver.

### addLast

    @Deprecated
    public DependencyResolver addLast(Object userDescription, Closure configureClosure)

  Adds a resolver to this container, at the end of the resolver sequence. The resolver is configured using the given configure closure.
  throws:
    InvalidUserDataException when a resolver with the given name already exists in this container.
  deprecated:
    Use RepositoryHandler.maven or add(ArtifactRepository) instead.
  Parameters:
    `userDescription` - The resolver definition. See addLast(Object) for details of this parameter.
    `configureClosure` - The closure to use to configure the resolver.
  Returns:
    The added resolver.

### getAt

    public ArtifactRepository getAt(String name)

  {@inheritDoc}

### getByName

    public ArtifactRepository getByName(String name)

  {@inheritDoc}

### getByName

    public ArtifactRepository getByName(String name, Closure configureClosure)

  {@inheritDoc}

### getResolvers

    @Deprecated
    public List getResolvers()

  Returns the resolvers in this container, in sequence.
  deprecated:
    No replacement.
  Returns:
    The resolvers in sequence. Returns an empty list if this container is empty.

Gradle API 1.10