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

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

    org.gradle.api.artifacts.ResolverContainer
      org.gradle.api.DomainObjectCollection
          org.gradle.api.NamedDomainObjectSet
              java.lang.Iterable
                  java.util.Collection
                      org.gradle.api.NamedDomainObjectCollection

All Superinterfaces:
  DomainObjectCollection, NamedDomainObjectSet, NamedDomainObjectCollection

    public interface ResolverContainer
    extends org.gradle.util.Configurable, NamedDomainObjectSet

A `ResolverContainer` is responsible for managing a set of org.apache.ivy.plugins.resolver.DependencyResolver instances. Resolvers 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 accessable as read-only properties of the container, using the name of the resolver as the property name. For example:

     resolvers.addLastt('myResolver')
     resolvers.myResolver.addArtifactPattern(somePattern)

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:

     resolvers.addLast('myResolver')
     resolvers.myResolver {
         addArtifactPattern(somePattern)
     }

Authors:
  Hans Dockter

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

Method Summary
`boolean` | `add(org.apache.ivy.plugins.resolver.DependencyResolver resolver)` Delegates to addLast(Object).
`boolean` | `add(org.apache.ivy.plugins.resolver.DependencyResolver resolver, groovy.lang.Closure configureClosure)` Delegates to addLast(Object,Closure).
`org.apache.ivy.plugins.resolver.DependencyResolver` | `addAfter(java.lang.Object userDescription, java.lang.String previousResolver)` Adds a resolver to this container, after the given resolver.
`org.apache.ivy.plugins.resolver.DependencyResolver` | `addAfter(java.lang.Object userDescription, java.lang.String previousResolver, groovy.lang.Closure configureClosure)` Adds a resolver to this container, after the given resolver.
`org.apache.ivy.plugins.resolver.DependencyResolver` | `addBefore(java.lang.Object userDescription, java.lang.String nextResolver)` Adds a resolver to this container, before the given resolver.
`org.apache.ivy.plugins.resolver.DependencyResolver` | `addBefore(java.lang.Object userDescription, java.lang.String nextResolver, groovy.lang.Closure configureClosure)` Adds a resolver to this container, before the given resolver.
`org.apache.ivy.plugins.resolver.DependencyResolver` | `addFirst(java.lang.Object userDescription)` Adds a resolver to this container, at the start of the resolver sequence.
`org.apache.ivy.plugins.resolver.DependencyResolver` | `addFirst(java.lang.Object userDescription, groovy.lang.Closure configureClosure)` Adds a resolver to this container, at the start of the resolver sequence.
`org.apache.ivy.plugins.resolver.DependencyResolver` | `addLast(java.lang.Object userDescription)` Adds a resolver to this container, at the end of the resolver sequence.
`org.apache.ivy.plugins.resolver.DependencyResolver` | `addLast(java.lang.Object userDescription, groovy.lang.Closure configureClosure)` Adds a resolver to this container, at the end of the resolver sequence.
`org.apache.ivy.plugins.resolver.DependencyResolver` | `getAt(java.lang.String name)` {@inheritDoc}
`org.apache.ivy.plugins.resolver.DependencyResolver` | `getByName(java.lang.String name)` {@inheritDoc}
`org.apache.ivy.plugins.resolver.DependencyResolver` | `getByName(java.lang.String name, groovy.lang.Closure configureClosure)` {@inheritDoc}
`java.io.File` | `getMavenPomDir()`
`Conf2ScopeMappingContainer` | `getMavenScopeMappings()`
`java.util.List` | `getResolvers()` Returns the resolvers in this container, in sequence.
`void` | `setMavenPomDir(java.io.File mavenPomDir)`

Methods inherited from interface NamedDomainObjectSet
matching, matching, withType

Methods inherited from interface org.gradle.util.Configurable
org.gradle.util.Configurable#configure(groovy.lang.Closure)

Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

Field Detail

### DEFAULT_CACHE_ARTIFACT_PATTERN

    public java.lang.String DEFAULT_CACHE_ARTIFACT_PATTERN

### DEFAULT_CACHE_IVY_PATTERN

    public java.lang.String DEFAULT_CACHE_IVY_PATTERN

### DEFAULT_MAVEN_CENTRAL_REPO_NAME

    public java.lang.String DEFAULT_MAVEN_CENTRAL_REPO_NAME

### DEFAULT_MAVEN_LOCAL_REPO_NAME

    public java.lang.String DEFAULT_MAVEN_LOCAL_REPO_NAME

### INTERNAL_REPOSITORY_NAME

    public java.lang.String INTERNAL_REPOSITORY_NAME

### MAVEN_CENTRAL_URL

    public java.lang.String MAVEN_CENTRAL_URL

### MAVEN_REPO_PATTERN

    public java.lang.String MAVEN_REPO_PATTERN

### RESOLVER_NAME

    public java.lang.String RESOLVER_NAME

### RESOLVER_URL

    public java.lang.String RESOLVER_URL

Method Detail

### add

    public boolean add(org.apache.ivy.plugins.resolver.DependencyResolver resolver)

  Delegates to addLast(Object).

### add

    public boolean add(org.apache.ivy.plugins.resolver.DependencyResolver resolver, groovy.lang.Closure configureClosure)

  Delegates to addLast(Object,Closure).

### addAfter

    public org.apache.ivy.plugins.resolver.DependencyResolver addAfter(java.lang.Object userDescription, java.lang.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:
    InvalidUserDataException when the given previous resolver does not exist in this container.
  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

    public org.apache.ivy.plugins.resolver.DependencyResolver addAfter(java.lang.Object userDescription, java.lang.String previousResolver, groovy.lang.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:
    InvalidUserDataException when the given previous resolver does not exist in this container.
  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

    public org.apache.ivy.plugins.resolver.DependencyResolver addBefore(java.lang.Object userDescription, java.lang.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:
    InvalidUserDataException when the given next resolver does not exist in this container.
  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

    public org.apache.ivy.plugins.resolver.DependencyResolver addBefore(java.lang.Object userDescription, java.lang.String nextResolver, groovy.lang.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:
    InvalidUserDataException when the given next resolver does not exist in this container.
  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 org.apache.ivy.plugins.resolver.DependencyResolver addFirst(java.lang.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.
  Parameters:
    `userDescription` - The resolver definition. See addLast(Object) for details of this parameter.
  Returns:
    The added resolver.

### addFirst

    public org.apache.ivy.plugins.resolver.DependencyResolver addFirst(java.lang.Object userDescription, groovy.lang.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.
  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 org.apache.ivy.plugins.resolver.DependencyResolver addLast(java.lang.Object userDescription)

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

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

Parameters:
  `userDescription` - The resolver definition.

Returns:
  The added resolver.

### addLast

    public org.apache.ivy.plugins.resolver.DependencyResolver addLast(java.lang.Object userDescription, groovy.lang.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.
  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 org.apache.ivy.plugins.resolver.DependencyResolver getAt(java.lang.String name)

  {@inheritDoc}

### getByName

    public org.apache.ivy.plugins.resolver.DependencyResolver getByName(java.lang.String name)

  {@inheritDoc}

### getByName

    public org.apache.ivy.plugins.resolver.DependencyResolver getByName(java.lang.String name, groovy.lang.Closure configureClosure)

  {@inheritDoc}

### getMavenPomDir

    public java.io.File getMavenPomDir()

### getMavenScopeMappings

    public Conf2ScopeMappingContainer getMavenScopeMappings()

### getResolvers

    public java.util.List getResolvers()

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

### setMavenPomDir

    public void setMavenPomDir(java.io.File mavenPomDir)

Groovy Documentation