# Configuration

API Documentation: | `Configuration`

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

### Properties

Property | Description
`allArtifactFiles` | The artifacts of this configuration as a `FileCollection`, including artifacts of extended configurations.
`allArtifacts` | The artifacts of this configuration including the artifacts of extended configurations.
`allDependencies` | Gets the set of dependencies of type T for this configuration including those contributed by superconfigurations.
`artifacts` | The artifacts of this configuration excluding the artifacts of extended configurations.
`buildArtifacts` | Returns a `TaskDependency` object containing all required dependencies to build the artifacts belonging to this configuration or to one of its super configurations.
`buildDependencies` | 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.
`dependencies` | Gets the set of dependencies of type T directly contained in this configuration (ignoring superconfigurations).
`description` | The description for this configuration.
`excludeRules` | The exclude rules applied for resolving any dependency of this configuration.
`extendsFrom` | The names of the configurations which this configuration extends from. The artifacts of the super configurations are also available in this configuration.
`hierarchy` | Gets a ordered set including this configuration and all superconfigurations recursively.
`name` | The name of this configuration.
`resolvedConfiguration` | 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).
`state` | The state of the configuration.
`transitive` | 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.
`visible` | Returns true if this is a visible configuration. A visible configuration is usable outside the project it belongs to. The default value is true.

### Property details

#### `FileCollection` `allArtifactFiles` (read-only)

The artifacts of this configuration as a `FileCollection`, including artifacts of extended configurations.

#### ``DomainObjectSet`<`PublishArtifact`>` `allArtifacts` (read-only)

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

#### ``DomainObjectSet`<`T`>` `allDependencies` (read-only)

Gets the set of dependencies of type T for this configuration including those contributed by superconfigurations.

The returned set is live, in that any future dependencies added to this configuration that match the type will appear in the returned set.

#### ``DomainObjectSet`<`PublishArtifact`>` `artifacts` (read-only)

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

#### `TaskDependency` `buildArtifacts` (read-only)

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

#### `TaskDependency` `buildDependencies` (read-only)

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.

#### ``DomainObjectSet`<`T`>` `dependencies` (read-only)

Gets the set of dependencies of type T directly contained in this configuration (ignoring superconfigurations).

The returned set is live, in that any future dependencies added to this configuration that match the type will appear in the returned set.

#### `String` `description`

The description for this configuration.

#### ``Set`<`ExcludeRule`>` `excludeRules` (read-only)

The exclude rules applied for resolving any dependency of this configuration.

#### ``Set`<`Configuration`>` `extendsFrom`

The names of the configurations which this configuration extends from. The artifacts of the super configurations are also available in this configuration.

#### ``Set`<`Configuration`>` `hierarchy` (read-only)

Gets a ordered set including this configuration and all superconfigurations recursively.

#### `String` `name` (read-only)

The name of this configuration.

#### `ResolvedConfiguration` `resolvedConfiguration` (read-only)

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).

#### `State` `state` (read-only)

The state of the configuration.

#### `boolean` `transitive`

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.

#### `boolean` `visible`

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

### Script blocks

No script blocks

### Methods

Method | Description
`addArtifact(artifact)` | Adds an artifact to be published to this configuration.
`addDependency(dependency)` | Adds a dependency to this 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. `Configuration.getHierarchy()` for the copy will not include any superconfigurations.
`copy(dependencySpec)` | Takes a closure which gets coerced into a Spec. Behaves otherwise in the same way as `Configuration.copy()`
`copy(dependencySpec)` | Creates a copy of this configuration ignoring superconfigurations (see `Configuration.copy()` but filtering the dependencies using the specified dependency spec. `Type` provides some predefined dependency specs.
`copyRecursive()` | Creates a copy of this configuration that contains the dependencies directly in this configuration and those derived from superconfigurations. The new configuration will be in the UNRESOLVED state, but will retain all other attributes of this configuration except superconfigurations. `Configuration.getHierarchy()` for the copy will not include any superconfigurations.
`copyRecursive(dependencySpec)` | Takes a closure which gets coerced into a Spec. Behaves otherwise in the same way as `Configuration.copyRecursive()`
`copyRecursive(dependencySpec)` | Creates a copy of this configuration with dependencies from superconfigurations (see `Configuration.copyRecursive()`) but filtering the dependencies using the dependencySpec. `Type` provides some predefined dependency specs.
`exclude(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()`.
`extendsFrom(superConfigs)` | Adds the given configurations to the set of configuration which this configuration extends from.
`fileCollection(dependencySpecClosure)` | Takes a closure which gets coerced into a Spec. Behaves otherwise in the same way as `Configuration.fileCollection()`.
`fileCollection(dependencies)` | Resolves this configuration lazily. 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.
`fileCollection(dependencySpec)` | Resolves this configuration lazily. 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.
`files(dependencySpecClosure)` | Takes a closure which gets coerced into a Spec. Behaves otherwise in the same way as `Configuration.files()`.
`files(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.
`files(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.
`getAllDependencies()` | Gets the complete set of dependencies including those contributed by superconfigurations.
`getAllDependencies(type)` | Gets the set of dependencies of type T for this configuration including those contributed by superconfigurations.
`getDependencies()` | Gets the set of dependencies directly contained in this configuration (ignoring superconfigurations).
`getDependencies(type)` | Gets the set of dependencies of type T directly contained in this configuration (ignoring superconfigurations).
`removeArtifact(artifact)` | Removes an artifact from the artifacts to be published to this configuration.

### Method details

#### `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). The new configuation will be in the UNRESOLVED state, but will retain all other attributes of this configuration except superconfigurations. `Configuration.getHierarchy()` for the copy will not include any superconfigurations.

#### `Configuration` `copy`(`Closure` dependencySpec)

Takes a closure which gets coerced into a Spec. Behaves otherwise in the same way as `Configuration.copy()`

#### `Configuration` `copy`(``Spec`<`Dependency`>` dependencySpec)

Creates a copy of this configuration ignoring superconfigurations (see `Configuration.copy()` but filtering the dependencies using the specified dependency spec. `Type` provides some predefined dependency specs.

#### `Configuration` `copyRecursive`()

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

#### `Configuration` `copyRecursive`(`Closure` dependencySpec)

Takes a closure which gets coerced into a Spec. Behaves otherwise in the same way as `Configuration.copyRecursive()`

#### `Configuration` `copyRecursive`(``Spec`<`Dependency`>` dependencySpec)

Creates a copy of this configuration with dependencies from superconfigurations (see `Configuration.copyRecursive()`) but filtering the dependencies using the dependencySpec. `Type` provides some predefined dependency specs.

#### `Configuration` `exclude`(``Map`<`String`, `String`>` 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()`.

#### `Configuration` `extendsFrom`(``Configuration`...` superConfigs)

Adds the given configurations to the set of configuration which this configuration extends from.

#### `FileCollection` `fileCollection`(`Closure` dependencySpecClosure)

Takes a closure which gets coerced into a Spec. Behaves otherwise in the same way as `Configuration.fileCollection()`.

#### `FileCollection` `fileCollection`(``Dependency`...` dependencies)

Resolves this configuration lazily. 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.

#### `FileCollection` `fileCollection`(``Spec`<`Dependency`>` dependencySpec)

Resolves this configuration lazily. 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.

#### ``Set`<`File`>` `files`(`Closure` dependencySpecClosure)

Takes a closure which gets coerced into a Spec. Behaves otherwise in the same way as `Configuration.files()`.

#### ``Set`<`File`>` `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.

#### ``Set`<`File`>` `files`(``Spec`<`Dependency`>` 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.

#### ``DomainObjectSet`<`Dependency`>` `getAllDependencies`()

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

#### ``DomainObjectSet`<`T`>` `getAllDependencies`(``Class`<`T`>` type)

Gets the set of dependencies of type T for this configuration including those contributed by superconfigurations.

The returned set is live, in that any future dependencies added to this configuration that match the type will appear in the returned set.

#### ``DomainObjectSet`<`Dependency`>` `getDependencies`()

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

#### ``DomainObjectSet`<`T`>` `getDependencies`(``Class`<`T`>` type)

Gets the set of dependencies of type T directly contained in this configuration (ignoring superconfigurations).

The returned set is live, in that any future dependencies added to this configuration that match the type will appear in the returned set.

#### `Configuration` `removeArtifact`(`PublishArtifact` artifact)

Removes an artifact from the artifacts to be published to this configuration.