api / org.gradle.api.artifacts / Configuration / copy

copy

abstract fun copy(): Configuration

Creates a copy of this configuration that only contains the dependencies directly in this configuration (without contributions from superconfigurations). The new configuration 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

abstract fun copy(dependencySpec: Spec<in Dependency>): Configuration

Creates a copy of this configuration ignoring superconfigurations (see #copy() but filtering the dependencies using the specified dependency spec.

Parameters

dependencySpec - filtering requirements

Return
copy of this configuration

abstract fun copy(dependencySpec: Closure<Any>): Configuration

Takes a closure which gets coerced into a Spec. Behaves otherwise in the same way as #copy(org.gradle.api.specs.Spec)

Parameters

dependencySpec - filtering requirements

Return
copy of this configuration