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

## org.gradle.api.artifacts
Interface ConfigurationContainer

    org.gradle.api.DomainObjectContainer
      org.gradle.api.artifacts.ConfigurationContainer
          org.gradle.api.DomainObjectCollection

All Superinterfaces:
  DomainObjectContainer, DomainObjectCollection

    interface ConfigurationContainer
    extends DomainObjectContainer

A `ConfigurationContainer` is responsible for managing a set of Configuration instances.

You can obtain a `ConfigurationContainer` instance by calling org.gradle.api.Project#getConfigurations(), or using the `configurations` property in your build script.

The configurations in a container are accessable as read-only properties of the container, using the name of the configuration as the property name. For example:

     configurations.add('myConfiguration')
     configurations.myConfiguration.transitive = false

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

     configurations.add('myConfiguration')
     configurations.myConfiguration {
         transitive = false
     }

author:
  Hans Dockter

Method Summary
`Configuration` | `add(java.lang.String name)` Adds a configuration with the given name.
`Configuration` | `add(java.lang.String name, Closure configureClosure)` Adds a configuration with the given name.
`Configuration` | `detachedConfiguration(Dependency dependencies)` Creates a configuration, but does not add it to this container.
`Configuration` | `getAt(java.lang.String name)` {
`Configuration` | `getByName(java.lang.String name)` {
`Configuration` | `getByName(java.lang.String name, Closure configureClosure)` {

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
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll

Method Detail

### add

    public Configuration add(java.lang.String name)

  Adds a configuration with the given name.
  param:
    name The name of the new configuration.
  return:
    The newly added configuration.
  throws:
    InvalidUserDataException when a configuration with the given name already exists in this container.

### add

    public Configuration add(java.lang.String name, Closure configureClosure)

  Adds a configuration with the given name. The given configuration closure is executed against the configuration before it is returned from this method.
  param:
    name The name of the new configuration.
  param:
    configureClosure The closure to use to configure the configuration.
  return:
    The newly added configuration.
  throws:
    InvalidUserDataException when a configuration with the given name already exists in this container.

### detachedConfiguration

    public Configuration detachedConfiguration(Dependency dependencies)

  Creates a configuration, but does not add it to this container.
  param:
    dependencies The dependencies of the configuration.
  return:
    The configuration.

### getAt

    public Configuration getAt(java.lang.String name)

  {@inheritDoc}

### getByName

    public Configuration getByName(java.lang.String name)

  {@inheritDoc}

### getByName

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

  {@inheritDoc}

Groovy Documentation