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

## org.gradle.api.artifacts
Interface Configuration

    org.gradle.api.file.FileCollection
      org.gradle.api.artifacts.Configuration

All Superinterfaces:
  FileCollection

    interface Configuration
    extends FileCollection

A `Configuration` represents a group of artifacts and their dependencies.

Nested Class Summary
`enum` | `Configuration.State` The states a configuration can be into.

Method Summary
`Configuration` | `addArtifact(PublishArtifact artifact)` Adds an artifact to be published to this configuration.
`void` | `addDependency(Dependency dependency)` Adds a dependency to this configuration
`Configuration` | `copy()` Creates a copy of this configuration that only contains the dependencies directly in this configuration (without contributions from superconfigurations).
`Configuration` | `copy(Spec dependencySpec)` Creates a copy of this configuration ignoring superconfigurations (see { the dependencies using the dependencySpec.
`Configuration` | `copy(Closure dependencySpec)` Takes a closure which gets coerced into a Spec.
`Configuration` | `copyRecursive()` Creates a copy of this configuration that contains the dependencies directly in this configuration and those derived from superconfigurations.
`Configuration` | `copyRecursive(Spec dependencySpec)` Creates a copy of this configuration with dependencies from superconfigurations (see { but filtering the dependencies using the dependencySpec.
`Configuration` | `copyRecursive(Closure dependencySpec)` Takes a closure which gets coerced into a Spec.
`Configuration` | `exclude(Map excludeProperties)` Adds an exclude rule to exclude transitive dependencies for all dependencies of this configuration.
`Configuration` | `extendsFrom(Configuration superConfigs)` Adds the given configurations to the set of configuration which this configuration extends from.
`FileCollection` | `fileCollection(Spec dependencySpec)` Resolves this configuration lazyly.
`FileCollection` | `fileCollection(Closure dependencySpecClosure)` Takes a closure which gets coerced into a Spec.
`FileCollection` | `fileCollection(Dependency dependencies)` Resolves this configuration lazyly.
`Set` | `files(Closure dependencySpecClosure)` Takes a closure which gets coerced into a Spec.
`Set` | `files(Spec dependencySpec)` Resolves this configuration.
`Set` | `files(Dependency dependencies)` Resolves this configuration.
`Set` | `getAll()` Returns all the configurations belonging to the same configuration container as this configuration (including this configuration).
`Set` | `getAllArtifacts()` Returns the artifacts of this configuration including the artifacts of extended configurations.
`Set` | `getAllDependencies()` Gets the complete set of dependencies including those contributed by superconfigurations.
`Set` | `getAllDependencies(java.lang.Class type)` Gets the set of dependencies of type T for this configuration including thos contributed by superconfigurations.
`Set` | `getArtifacts()` Returns the artifacts of this configuration excluding the artifacts of extended configurations.
`TaskDependency` | `getBuildArtifacts()` Returns a { belonging to this configuration or to one of its super configurations.
`TaskDependency` | `getBuildDependencies()` Returns a { (e.g. project dependencies) belonging to this configuration or to one of its super configurations.
`Set` | `getDependencies()` Gets the set of dependencies directly contained in this configuration (ignoring superconfigurations).
`Set` | `getDependencies(java.lang.Class type)` Gets the set of dependencies of type T directly contained in this configuration (ignoring superconfigurations).
`java.lang.String` | `getDescription()` Returns the description for this configuration.
`Set` | `getExcludeRules()` Returns the exclude rules applied for resolving any dependency of this configuration.
`Set` | `getExtendsFrom()` Returns the names of the configurations which this configuration extends from.
`List` | `getHierarchy()` Gets a list including this configuration and all superconfigurations recursively.
`java.lang.String` | `getName()` Returns the name of this configuration.
`ResolvedConfiguration` | `getResolvedConfiguration()` Resolves this configuration.
`State` | `getState()` A {
`TaskDependency` | `getTaskDependencyFromProjectDependency(boolean useDependedOn, java.lang.String taskName)` Returns a TaskDependency object containing dependencies on all tasks with the specified name from project dependencies related to this configuration or one of its super configurations.
`java.lang.String` | `getUploadInternalTaskName()` Returns the name of the task that upload the artifacts of this configuration to the internal Gradle repository used resolving inter-project dependencies.
`java.lang.String` | `getUploadTaskName()` Returns the name of the task that upload the artifacts of this configuration to repositories declared by the user.
`boolean` | `isTransitive()` Returns the transitivity of this configuration.
`boolean` | `isVisible()` Returns true if this is a visible configuration.
`void` | `publish(List publishRepositories, PublishInstruction publishInstruction)` Publishes the artifacts of this configuration to the specified repositories.
`Configuration` | `removeArtifact(PublishArtifact artifact)` Removes an artifact from the artifacts to be published to this configuration.
`Set` | `resolve()` Resolves this configuration.
`Configuration` | `setDescription(java.lang.String description)` Sets the description for this configuration.
`Configuration` | `setExtendsFrom(Set superConfigs)` Sets the configurations which this configuration extends from.
`Configuration` | `setTransitive(boolean t)` Sets the transitivity of this configuration.
`Configuration` | `setVisible(boolean visible)` Sets the visibility of this configuration.
`Configuration` | `valueOf(java.lang.String name)` Returns the enum constant of this type with the specified name.
`Configuration[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

Methods inherited from interface FileCollection
add, addToAntBuilder, addToAntBuilder, asType, getAsFileTree, getAsPath, getFiles, getSingleFile, plus, stopExecutionIfEmpty

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

### addArtifact

    public Configuration addArtifact(PublishArtifact artifact)

  Adds an artifact to be published to this configuration.
  param:
    artifact The artifact.
  return:
    this

### addDependency

    public void addDependency(Dependency dependency)

  Adds a dependency to this configuration
  param:
    dependency The dependency to be added.

### copy

    public Configuration copy()

  Creates a copy of this configuration that only contains the dependencies directly in this configuration (without contributions from superconfigurations). The new configuation will be in the UNRESOLVED state, but will retain all other attributes of this configuration except superconfigurations. #getHierarchy() for the copy will not include any superconfigurations.
  return:
    copy of this configuration

### copy

    public Configuration copy(Spec dependencySpec)

  Creates a copy of this configuration ignoring superconfigurations (see #copy() but filtering the dependencies using the dependencySpec. The dependencySpec may be obtained from org.gradle.api.artifacts.specs.DependencySpecs DependencySpecs.type() like DependencySpecs.type(Type.EXTERNAL)
  param:
    dependencySpec filtering requirements
  return:
    copy of this configuration

### copy

    public Configuration copy(Closure dependencySpec)

  Takes a closure which gets coerced into a Spec. Behaves otherwise in the same way as #copy(org.gradle.api.specs.Spec)
  param:
    dependencySpec filtering requirements
  return:
    copy of this configuration

### copyRecursive

    public Configuration copyRecursive()

  Creates a copy of this configuration that contains the dependencies directly in this configuration and those derived from superconfigurations. The new configuation will be in the UNRESOLVED state, but will retain all other attributes of this configuration except superconfigurations. #getHierarchy() for the copy will not include any superconfigurations.
  return:
    copy of this configuration

### copyRecursive

    public Configuration copyRecursive(Spec dependencySpec)

  Creates a copy of this configuration with dependencies from superconfigurations (see #copyRecursive()) but filtering the dependencies using the dependencySpec. The dependencySpec may be obtained from org.gradle.api.artifacts.specs.DependencySpecs DependencySpecs.type() like DependencySpecs.type(Type.EXTERNAL)
  param:
    dependencySpec filtering requirements
  return:
    copy of this configuration

### copyRecursive

    public Configuration copyRecursive(Closure dependencySpec)

  Takes a closure which gets coerced into a Spec. Behaves otherwise in the same way as #copyRecursive(org.gradle.api.specs.Spec)
  param:
    dependencySpec filtering requirements
  return:
    copy of this configuration

### exclude

    public Configuration exclude(Map excludeProperties)

  Adds an exclude rule to exclude transitive dependencies for all dependencies of this configuration. You can also add exclude rules per-dependency. See ModuleDependency#exclude(java.util.Map).
  param:
    excludeProperties the properties to define the exclude rule.
  return:
    this

### extendsFrom

    public Configuration extendsFrom(Configuration superConfigs)

  Adds the given configurations to the set of configuration which this configuration extends from.
  param:
    superConfigs The super configurations.
  return:
    this configuration

### fileCollection

    public FileCollection fileCollection(Spec dependencySpec)

  Resolves this configuration lazyly. The resolve happens when the elements of the returned FileCollection get accessed the first time. This locates and downloads the files which make up this configuration. Only the resulting set of files belonging to the subset of dependencies specified by the dependencySpec is contained in the FileCollection.
  param:
    dependencySpec The spec describing a filter applied to the all the dependencies of this configuration (including dependencies from extended configurations).
  return:
    The FileCollection with a subset of dependencies of this configuration.

### fileCollection

    public FileCollection fileCollection(Closure dependencySpecClosure)

  Takes a closure which gets coerced into a Spec. Behaves otherwise in the same way as #fileCollection(org.gradle.api.specs.Spec).
  param:
    dependencySpecClosure The closure describing a filter applied to the all the dependencies of this configuration (including dependencies from extended configurations).
  return:
    The FileCollection with a subset of dependencies of this configuration.

### fileCollection

    public FileCollection fileCollection(Dependency dependencies)

  Resolves this configuration lazyly. The resolve happens when the elements of the returned FileCollection get accessed the first time. This locates and downloads the files which make up this configuration. Only the resulting set of files belonging to specified dependencies is contained in the FileCollection.
  param:
    dependencies The dependencies for which the FileCollection should contain the files.
  return:
    The FileCollection with a subset of dependencies of this configuration.

### files

    public Set files(Closure dependencySpecClosure)

  Takes a closure which gets coerced into a Spec. Behaves otherwise in the same way as #files(org.gradle.api.specs.Spec).
  param:
    dependencySpecClosure The closure describing a filter applied to the all the dependencies of this configuration (including dependencies from extended configurations).
  return:
    The files of a subset of dependencies of this configuration.

### files

    public Set files(Spec dependencySpec)

  Resolves this configuration. This locates and downloads the files which make up this configuration. But only the resulting set of files belonging to the subset of dependencies specified by the dependencySpec is returned.
  param:
    dependencySpec The spec describing a filter applied to the all the dependencies of this configuration (including dependencies from extended configurations).
  return:
    The files of a subset of dependencies of this configuration.

### files

    public Set files(Dependency dependencies)

  Resolves this configuration. This locates and downloads the files which make up this configuration. But only the resulting set of files belonging to the specified dependencies is returned.
  param:
    dependencies The dependences to be resolved
  return:
    The files of a subset of dependencies of this configuration.

### getAll

    public Set getAll()

  Returns all the configurations belonging to the same configuration container as this configuration (including this configuration).

### getAllArtifacts

    public Set getAllArtifacts()

  Returns the artifacts of this configuration including the artifacts of extended configurations.

### getAllDependencies

    public Set getAllDependencies()

  Gets the complete set of dependencies including those contributed by superconfigurations.
  return:
    the set of dependencies

### getAllDependencies

    public Set getAllDependencies(java.lang.Class type)

  Gets the set of dependencies of type T for this configuration including thos contributed by superconfigurations.
  param:
    type the dependency type
  param:
    the dependency type
  return:
    The set. Returns an empty set if there are no such dependencies.

### getArtifacts

    public Set getArtifacts()

  Returns the artifacts of this configuration excluding the artifacts of extended configurations.

### getBuildArtifacts

    public TaskDependency getBuildArtifacts()

  Returns a `TaskDependency` object containing all required dependencies to build the artifacts belonging to this configuration or to one of its super configurations.
  return:
    a task dependency object

### getBuildDependencies

    public TaskDependency getBuildDependencies()

  Returns a `TaskDependency` object containing all required dependencies to build the internal dependencies (e.g. project dependencies) belonging to this configuration or to one of its super configurations.
  return:
    a TaskDependency object

### getDependencies

    public Set getDependencies()

  Gets the set of dependencies directly contained in this configuration (ignoring superconfigurations).
  return:
    the set of dependencies

### getDependencies

    public Set getDependencies(java.lang.Class type)

  Gets the set of dependencies of type T directly contained in this configuration (ignoring superconfigurations).
  param:
    type the dependency type
  param:
    the dependency type
  return:
    The set. Returns an empty set if there are no such dependencies.

### getDescription

    public java.lang.String getDescription()

  Returns the description for this configuration.
  return:
    the description. May be null.

### getExcludeRules

    public Set getExcludeRules()

  Returns the exclude rules applied for resolving any dependency of this configuration.
  see:
    #exclude(java.util.Map)

### getExtendsFrom

    public Set getExtendsFrom()

  Returns the names of the configurations which this configuration extends from. The artifacts of the super configurations are also available in this configuration.
  return:
    The super configurations. Returns an empty set when this configuration does not extend any others.

### getHierarchy

    public List getHierarchy()

  Gets a list including this configuration and all superconfigurations recursively.
  return:
    the list of all configurations

### getName

    public java.lang.String getName()

  Returns the name of this configuration.
  return:
    The configuration name, never null.

### getResolvedConfiguration

    public ResolvedConfiguration getResolvedConfiguration()

  Resolves this configuration. This locates and downloads the files which make up this configuration, and returns a ResolvedConfiguration that may be used to determine information about the resolve (including errors).
  return:
    The ResolvedConfiguration object

### getState

    public State getState()

  A `Configuration` represents a group of artifacts and their dependencies.

### getTaskDependencyFromProjectDependency

    public TaskDependency getTaskDependencyFromProjectDependency(boolean useDependedOn, java.lang.String taskName)

  Returns a TaskDependency object containing dependencies on all tasks with the specified name from project dependencies related to this configuration or one of its super configurations. These other projects may be projects this configuration depends on or projects with a similarly named configuation that depend on this one based on the useDependOn argument.
  param:
    useDependedOn if true, add tasks from project dependencies in this conifguration, otherwise use projects from configurations with the same name that depend on this one.
  param:
    taskName name of task to depend on
  return:
    the populated TaskDependency object

### getUploadInternalTaskName

    public java.lang.String getUploadInternalTaskName()

  Returns the name of the task that upload the artifacts of this configuration to the internal Gradle repository used resolving inter-project dependencies.

### getUploadTaskName

    public java.lang.String getUploadTaskName()

  Returns the name of the task that upload the artifacts of this configuration to repositories declared by the user.
  see:
    org.gradle.api.tasks.Upload

### isTransitive

    public boolean isTransitive()

  Returns the transitivity of this configuration. A transitive configuration contains the transitive closure of its direct dependencies, and all their dependencies. An intransitive configuration contains only the direct dependencies. The default value is true.
  return:
    true if this is a transitive configuration, false otherwise.

### isVisible

    public boolean isVisible()

  Returns true if this is a visible configuration. A visible configuration is usable outside the project it belongs to. The default value is true.
  return:
    true if this is a visible configuration.

### publish

    public void publish(List publishRepositories, PublishInstruction publishInstruction)

  Publishes the artifacts of this configuration to the specified repositories. This method is usually used only internally as the users use the associated upload tasks to upload the artifacts.
  param:
    publishRepositories The repositories to publish the artifacts to.
  param:
    publishInstruction Instructions for details of the upload.
  see:
    org.gradle.api.tasks.Upload
  see:
    #getUploadTaskName()

### removeArtifact

    public Configuration removeArtifact(PublishArtifact artifact)

  Removes an artifact from the artifacts to be published to this configuration.
  param:
    artifact The artifact.
  return:
    this

### resolve

    public Set resolve()

  Resolves this configuration. This locates and downloads the files which make up this configuration, and returns the resulting set of files.
  return:
    The files of this configuration.

### setDescription

    public Configuration setDescription(java.lang.String description)

  Sets the description for this configuration.
  param:
    description the description. May be null
  return:
    this configuration

### setExtendsFrom

    public Configuration setExtendsFrom(Set superConfigs)

  Sets the configurations which this configuration extends from.
  param:
    superConfigs The super configuration. Should not be null.
  return:
    this configuration

### setTransitive

    public Configuration setTransitive(boolean t)

  Sets the transitivity of this configuration. When set to true, this configuration will contain the transitive closure of its dependencies and their dependencies. The default value is true.
  param:
    t true if this is a transitive configuration.
  return:
    this configuration

### setVisible

    public Configuration setVisible(boolean visible)

  Sets the visibility of this configuration. When visible is set to true, this configuration is visibile outside the project it belongs to. The default value is true.
  param:
    visible true if this is a visible configuration
  return:
    this configuration

### valueOf

    Configuration valueOf(java.lang.String name)

  Returns the enum constant of this type with the specified name.

### values

    Configuration[] values()

  Returns an array containing the constants of this enum type, in the order they are declared.

Groovy Documentation