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

## org.gradle.api.artifacts
Interface ResolverContainer

    org.gradle.api.DomainObjectContainer
      org.gradle.api.artifacts.ResolverContainer
          org.gradle.api.DomainObjectCollection

All Superinterfaces:
  DomainObjectContainer, DomainObjectCollection

    interface ResolverContainer
    extends DomainObjectContainer

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 org.gradle.api.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.add('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.add('myResolver')
     resolvers.myResolver {
         addArtifactPattern(somePattern)
     }

author:
  Hans Dockter

Field Summary
`java.lang.String` | `BUILD_RESOLVER_PATTERN`
`java.lang.String` | `DEFAULT_CACHE_ARTIFACT_PATTERN`
`java.lang.String` | `DEFAULT_CACHE_DIR_NAME`
`java.lang.String` | `DEFAULT_CACHE_IVY_PATTERN`
`java.lang.String` | `DEFAULT_CACHE_NAME`
`java.lang.String` | `DEFAULT_MAVEN_CENTRAL_REPO_NAME`
`java.lang.String` | `FLAT_DIR_RESOLVER_PATTERN`
`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
`DependencyResolver` | `add(java.lang.Object userDescription)` Adds a resolver to this container, at the end of the resolver sequence.
`DependencyResolver` | `add(java.lang.Object userDescription, Closure configureClosure)` Adds a resolver to this container, at the end of the resolver sequence.
`DependencyResolver` | `addAfter(java.lang.Object userDescription, java.lang.String previousResolver)` Adds a resolver to this container, after the given resolver.
`DependencyResolver` | `addAfter(java.lang.Object userDescription, java.lang.String previousResolver, Closure configureClosure)` Adds a resolver to this container, after the given resolver.
`DependencyResolver` | `addBefore(java.lang.Object userDescription, java.lang.String nextResolver)` Adds a resolver to this container, before the given resolver.
`DependencyResolver` | `addBefore(java.lang.Object userDescription, java.lang.String nextResolver, Closure configureClosure)` Adds a resolver to this container, before the given resolver.
`DependencyResolver` | `addFirst(java.lang.Object userDescription)` Adds a resolver to this container, at the start of the resolver sequence.
`DependencyResolver` | `addFirst(java.lang.Object userDescription, Closure configureClosure)` Adds a resolver to this container, at the start of the resolver sequence.
`DependencyResolver` | `getAt(java.lang.String name)` {
`DependencyResolver` | `getByName(java.lang.String name)` {
`DependencyResolver` | `getByName(java.lang.String name, Closure configureClosure)` {
`File` | `getMavenPomDir()`
`Conf2ScopeMappingContainer` | `getMavenScopeMappings()`
`List` | `getResolvers()` Returns the resolvers in this container, in sequence.
`void` | `setMavenPomDir(File mavenPomDir)`

Methods inherited from interface DomainObjectContainer
addRule, getRules

Methods inherited from interface DomainObjectCollection
allObjects, allObjects, findAll, findByName, getAll, getAsMap, getAt, getByName, getByName, matching, whenObjectAdded, whenObjectAdded, whenObjectRemoved, withType

Methods inherited from interface java.lang.Iterable
iterator

Methods inherited from class java.lang.Object
hashCode, getClass, equals, toString, wait, wait, wait, notify, notifyAll

Field Detail

### BUILD_RESOLVER_PATTERN

    java.lang.String BUILD_RESOLVER_PATTERN

### DEFAULT_CACHE_ARTIFACT_PATTERN

    java.lang.String DEFAULT_CACHE_ARTIFACT_PATTERN

### DEFAULT_CACHE_DIR_NAME

    java.lang.String DEFAULT_CACHE_DIR_NAME

### DEFAULT_CACHE_IVY_PATTERN

    java.lang.String DEFAULT_CACHE_IVY_PATTERN

### DEFAULT_CACHE_NAME

    java.lang.String DEFAULT_CACHE_NAME

### DEFAULT_MAVEN_CENTRAL_REPO_NAME

    java.lang.String DEFAULT_MAVEN_CENTRAL_REPO_NAME

### FLAT_DIR_RESOLVER_PATTERN

    java.lang.String FLAT_DIR_RESOLVER_PATTERN

### INTERNAL_REPOSITORY_NAME

    java.lang.String INTERNAL_REPOSITORY_NAME

### MAVEN_CENTRAL_URL

    java.lang.String MAVEN_CENTRAL_URL

### MAVEN_REPO_PATTERN

    java.lang.String MAVEN_REPO_PATTERN

### RESOLVER_NAME

    java.lang.String RESOLVER_NAME

### RESOLVER_URL

    java.lang.String RESOLVER_URL

Method Detail

### add

    public DependencyResolver add(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.

param:
  userDescription The resolver definition.

return:
  The added resolver.

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

### add

    public DependencyResolver add(java.lang.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.
  param:
    userDescription The resolver definition. See #add(Object) for details of this parameter.
  param:
    configureClosure The closure to use to configure the resolver.
  return:
    The added resolver.
  throws:
    InvalidUserDataException when a resolver with the given name already exists in this container.

### addAfter

    public DependencyResolver addAfter(java.lang.Object userDescription, java.lang.String previousResolver)

  Adds a resolver to this container, after the given resolver.
  param:
    userDescription The resolver definition. See #add(Object) for details of this parameter.
  param:
    previousResolver The existing resolver to add the new resolver after.
  return:
    The added 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.

### addAfter

    public DependencyResolver addAfter(java.lang.Object userDescription, java.lang.String previousResolver, Closure configureClosure)

  Adds a resolver to this container, after the given resolver. The resolver is configured using the given configure closure.
  param:
    userDescription The resolver definition. See #add(Object) for details of this parameter.
  param:
    previousResolver The existing resolver to add the new resolver after.
  param:
    configureClosure The closure to use to configure the resolver.
  return:
    The added 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.

### addBefore

    public DependencyResolver addBefore(java.lang.Object userDescription, java.lang.String nextResolver)

  Adds a resolver to this container, before the given resolver.
  param:
    userDescription The resolver definition. See #add(Object) for details of this parameter.
  param:
    nextResolver The existing resolver to add the new resolver before.
  return:
    The added 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.

### addBefore

    public DependencyResolver addBefore(java.lang.Object userDescription, java.lang.String nextResolver, Closure configureClosure)

  Adds a resolver to this container, before the given resolver. The resolver is configured using the given configure closure.
  param:
    userDescription The resolver definition. See #add(Object) for details of this parameter.
  param:
    nextResolver The existing resolver to add the new resolver before.
  param:
    configureClosure The closure to use to configure the resolver.
  return:
    The added 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.

### addFirst

    public DependencyResolver addFirst(java.lang.Object userDescription)

  Adds a resolver to this container, at the start of the resolver sequence.
  param:
    userDescription The resolver definition. See #add(Object) for details of this parameter.
  return:
    The added resolver.
  throws:
    InvalidUserDataException when a resolver with the given name already exists in this container.

### addFirst

    public DependencyResolver addFirst(java.lang.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.
  param:
    userDescription The resolver definition. See #add(Object) for details of this parameter.
  param:
    configureClosure The closure to use to configure the resolver.
  return:
    The added resolver.
  throws:
    InvalidUserDataException when a resolver with the given name already exists in this container.

### getAt

    public DependencyResolver getAt(java.lang.String name)

  {@inheritDoc}

### getByName

    public DependencyResolver getByName(java.lang.String name)

  {@inheritDoc}

### getByName

    public DependencyResolver getByName(java.lang.String name, Closure configureClosure)

  {@inheritDoc}

### getMavenPomDir

    public File getMavenPomDir()

### getMavenScopeMappings

    public Conf2ScopeMappingContainer getMavenScopeMappings()

### getResolvers

    public List getResolvers()

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

### setMavenPomDir

    public void setMavenPomDir(File mavenPomDir)

Groovy Documentation