Interface Configuration
- All Superinterfaces:
- AntBuilderAware,- Buildable,- FileCollection,- HasAttributes,- HasConfigurableAttributes<Configuration>,- Iterable<File>,- Named
- All Known Subinterfaces:
- ConsumableConfiguration,- DependencyScopeConfiguration,- LegacyConfiguration,- ResolvableConfiguration
Configuration represents a group of artifacts and their dependencies.
 Find more information about declaring dependencies to a configuration
 or about managing configurations in docs for ConfigurationContainer
 
 Configuration is an instance of a FileCollection
 that contains all dependencies (see also getAllDependencies()) but not artifacts.
 If you want to refer to the artifacts declared in this configuration
 please use getArtifacts() or getAllArtifacts().
 Read more about declaring artifacts in the configuration in docs for ArtifactHandler
 Please see the Declaring Dependencies User Manual chapter for more information.
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic classDeprecated.static enumThe states a configuration can be into.Nested classes/interfaces inherited from interface org.gradle.api.file.FileCollectionFileCollection.AntType
- 
Method SummaryModifier and TypeMethodDescriptioncopy()Creates a copy of this configuration that only contains the dependencies directly in this configuration (without contributions from superconfigurations).Takes a closure which gets coerced into aSpec.copy(Spec<? super Dependency> dependencySpec) Creates a copy of this configuration ignoring superconfigurations (seecopy()but filtering the dependencies using the specified dependency spec.Creates a copy of this configuration that contains the dependencies directly in this configuration and those derived from superconfigurations.copyRecursive(Closure dependencySpec) Takes a closure which gets coerced into aSpec.copyRecursive(Spec<? super Dependency> dependencySpec) Creates a copy of this configuration with dependencies from superconfigurations (seecopyRecursive()) but filtering the dependencies using the dependencySpec.defaultDependencies(Action<? super DependencySet> action) Execute the given action if the configuration has no defined dependencies when it first participates in dependency resolution.Disables consistent resolution for this configuration.Adds an exclude rule to exclude transitive dependencies for all dependencies of this configuration.extendsFrom(Configuration... superConfigs) Adds the given configurations to the set of configuration which this configuration extends from.fileCollection(Closure dependencySpecClosure) Deprecated.UsegetIncoming().artifactView(Action)with acomponentFilterinstead.fileCollection(Dependency... dependencies) Deprecated.UsegetIncoming().artifactView(Action)with acomponentFilterinstead.fileCollection(Spec<? super Dependency> dependencySpec) Deprecated.UsegetIncoming().artifactView(Action)with acomponentFilterinstead.Deprecated.UsegetIncoming().artifactView(Action)with acomponentFilterinstead.files(Dependency... dependencies) Deprecated.UsegetIncoming().artifactView(Action)with acomponentFilterinstead.files(Spec<? super Dependency> dependencySpec) Deprecated.UsegetIncoming().artifactView(Action)with acomponentFilterinstead.default voidfromDependencyCollector(DependencyCollector collector) Use the given collector as a source for dependencies and dependency constraints.getAll()Deprecated.Returns the artifacts of this configuration including the artifacts of extended configurations.Gets the complete set of declared dependencies including those contributed by superconfigurations.Gets the complete set of dependency constraints including those contributed by superconfigurations.Returns the artifacts of this configuration excluding the artifacts of extended configurations.Returns aTaskDependencyobject containing all required dependencies to build the local dependencies (e.g.Gets the set of declared dependencies directly contained in this configuration (ignoring superconfigurations).Gets the set of dependency constraints directly contained in this configuration (ignoring superconfigurations).Returns the description for this configuration.Returns the exclude rules applied for resolving any dependency of this configuration.Returns the names of the configurations which this configuration extends from.Gets an ordered set including this configuration and all superconfigurations recursively.Returns aResolvableDependenciesinstance, exposing the results of dependency resolution.Returns the outgoingConfigurationPublicationsinstance that advertises and allows configuring the artifacts and variants published by this configuration.Returns the resolution strategy used by this configuration.Returns aResolvedConfiguration, a legacy view of the results of dependency resolution.getState()Returns the state of the configuration.getTaskDependencyFromProjectDependency(boolean useDependedOn, 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.Deprecated.This method will be removed in Gradle 9.0booleanReturns true if this configuration can be consumed from another project, or published.booleanReturns true if it is allowed to declare dependencies upon this configuration.booleanReturns true if it is allowed to query or resolve this configuration.booleanReturns the transitivity of this configuration.booleanReturns true if this is a visible configuration.voidoutgoing(Action<? super ConfigurationPublications> action) Configures the outgoingConfigurationPublicationsinstance that advertises and allows configuring the artifacts and variants published by this configuration.resolutionStrategy(Closure closure) The resolution strategy provides extra details on how to resolve this configuration.resolutionStrategy(Action<? super ResolutionStrategy> action) The resolution strategy provides extra details on how to resolve this configuration.resolve()Resolves this configuration.voidsetCanBeConsumed(boolean allowed) Configures if a configuration can be consumed.voidsetCanBeDeclared(boolean allowed) Configures if a configuration can have dependencies declared upon it.voidsetCanBeResolved(boolean allowed) Configures if a configuration can be resolved.setDescription(String description) Sets the description for this configuration.setExtendsFrom(Iterable<Configuration> superConfigs) Sets the configurations which this configuration extends from.setTransitive(boolean t) Sets the transitivity of this configuration.setVisible(boolean visible) Sets the visibility of this configuration.shouldResolveConsistentlyWith(Configuration versionsSource) Tells that this configuration, when resolved, should resolve versions consistently from the resolution result of another resolvable configuration.withDependencies(Action<? super DependencySet> action) Execute the given action before the configuration first participates in dependency resolution.Methods inherited from interface org.gradle.api.file.FileCollectionaddToAntBuilder, addToAntBuilder, contains, filter, filter, getAsFileTree, getAsPath, getElements, getFiles, getSingleFile, isEmpty, minus, plusMethods inherited from interface org.gradle.api.attributes.HasAttributesgetAttributesMethods inherited from interface org.gradle.api.attributes.HasConfigurableAttributesattributesMethods inherited from interface java.lang.IterableforEach, iterator, spliterator
- 
Method Details- 
getResolutionStrategyResolutionStrategy getResolutionStrategy()Returns the resolution strategy used by this configuration. The resolution strategy provides extra details on how to resolve this configuration. See docs forResolutionStrategyfor more info and examples.- Returns:
- resolution strategy
- Since:
- 1.0-milestone-6
- Implementation Requirements:
- Usage: This method should only be called on resolvable configurations, but will not warn if used otherwise.
 
- 
resolutionStrategyConfiguration resolutionStrategy(@DelegatesTo(value=ResolutionStrategy.class,strategy=1) Closure closure) The resolution strategy provides extra details on how to resolve this configuration. See docs forResolutionStrategyfor more info and examples.- Parameters:
- closure- closure applied to the- ResolutionStrategy
- Returns:
- this configuration instance
- Since:
- 1.0-milestone-6
- Implementation Requirements:
- Usage: This method should only be called on resolvable configurations, but will not warn if used otherwise.
 
- 
resolutionStrategyThe resolution strategy provides extra details on how to resolve this configuration. See docs forResolutionStrategyfor more info and examples.- Parameters:
- action- action applied to the- ResolutionStrategy
- Returns:
- this configuration instance
- Since:
- 3.1
- Implementation Requirements:
- Usage: This method should only be called on resolvable configurations, but will not warn if used otherwise.
 
- 
getStateConfiguration.State getState()Returns the state of the configuration.- Returns:
- The state of the configuration
- See Also:
- Implementation Requirements:
- Usage: This method should only be called on resolvable configurations, but will not warn if used otherwise.
 
- 
isVisibleboolean 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.- Returns:
- true if this is a visible configuration.
 
- 
setVisibleSets the visibility of this configuration. When visible is set to true, this configuration is visible outside the project it belongs to. The default value is true.- Parameters:
- visible- true if this is a visible configuration
- Returns:
- this configuration
- Implementation Requirements:
- Usage: This method should only be called on consumable configurations, but will not warn if used otherwise.
 
- 
getExtendsFromSet<Configuration> getExtendsFrom()Returns the names of the configurations which this configuration extends from. The artifacts of the super configurations are also available in this configuration.- Returns:
- The super configurations. Returns an empty set when this configuration does not extend any others.
 
- 
setExtendsFromSets the configurations which this configuration extends from.Configurations are only allowed to extend from other configurations in the same project. - Parameters:
- superConfigs- The super configuration. Should not be null.
- Returns:
- this configuration
 
- 
extendsFromAdds the given configurations to the set of configuration which this configuration extends from.Configurations are only allowed to extend from other configurations in the same project. - Parameters:
- superConfigs- The super configurations.
- Returns:
- this configuration
 
- 
isTransitiveboolean 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.- Returns:
- true if this is a transitive configuration, false otherwise.
 
- 
setTransitiveSets 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.- Parameters:
- t- true if this is a transitive configuration.
- Returns:
- this configuration
 
- 
getDescriptionReturns the description for this configuration.- Returns:
- the description. May be null.
 
- 
setDescriptionSets the description for this configuration.- Parameters:
- description- the description. May be null
- Returns:
- this configuration
 
- 
getHierarchySet<Configuration> getHierarchy()Gets an ordered set including this configuration and all superconfigurations recursively.- Returns:
- the set of all configurations
 
- 
resolveResolves this configuration. This locates and downloads the files which make up this configuration, and returns the resulting set of files.- Returns:
- The files of this configuration.
- Implementation Requirements:
- Usage: This method should only be called on resolvable configurations and will emit a deprecation warning if called on a configuration that does not permit this usage, or has allowed this usage but marked it as deprecated.
 
- 
filesDeprecated.UsegetIncoming().artifactView(Action)with acomponentFilterinstead.Takes a closure which gets coerced into aSpec. Behaves otherwise in the same way asfiles(org.gradle.api.specs.Spec).- Parameters:
- dependencySpecClosure- The closure describing a filter applied to the all the dependencies of this configuration (including dependencies from extended configurations).
- Returns:
- The files of a subset of dependencies of this configuration.
- Implementation Requirements:
- Usage: This method should only be called on resolvable configurations and should fail if called on a configuration that does not permit this usage. It should warn if called on a configuration that has allowed this usage but marked it as deprecated.
 
- 
filesDeprecated.UsegetIncoming().artifactView(Action)with acomponentFilterinstead.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.- Parameters:
- dependencySpec- The spec describing a filter applied to the all the dependencies of this configuration (including dependencies from extended configurations).
- Returns:
- The files of a subset of dependencies of this configuration.
- Implementation Requirements:
- Usage: This method should only be called on resolvable configurations and should fail if called on a configuration that does not permit this usage. It should warn if called on a configuration that has allowed this usage but marked it as deprecated.
 
- 
filesDeprecated.UsegetIncoming().artifactView(Action)with acomponentFilterinstead.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.- Parameters:
- dependencies- The dependencies to be resolved
- Returns:
- The files of a subset of dependencies of this configuration.
- Implementation Requirements:
- Usage: This method should only be called on resolvable configurations and should fail if called on a configuration that does not permit this usage. It should warn if called on a configuration that has allowed this usage but marked it as deprecated.
 
- 
fileCollectionDeprecated.UsegetIncoming().artifactView(Action)with acomponentFilterinstead.Resolves this configuration lazily. The resolve happens when the elements of the returnedFileCollectionget 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.- Parameters:
- dependencySpec- The spec describing a filter applied to the all the dependencies of this configuration (including dependencies from extended configurations).
- Returns:
- The FileCollection with a subset of dependencies of this configuration.
- Implementation Requirements:
- Usage: This method should only be called on resolvable configurations and should fail if called on a configuration that does not permit this usage. It should warn if called on a configuration that has allowed this usage but marked it as deprecated.
 
- 
fileCollectionDeprecated.UsegetIncoming().artifactView(Action)with acomponentFilterinstead.Takes a closure which gets coerced into aSpec. Behaves otherwise in the same way asfileCollection(org.gradle.api.specs.Spec).- Parameters:
- dependencySpecClosure- The closure describing a filter applied to the all the dependencies of this configuration (including dependencies from extended configurations).
- Returns:
- The FileCollection with a subset of dependencies of this configuration.
- Implementation Requirements:
- Usage: This method should only be called on resolvable configurations and should fail if called on a configuration that does not permit this usage. It should warn if called on a configuration that has allowed this usage but marked it as deprecated.
 
- 
fileCollectionDeprecated.UsegetIncoming().artifactView(Action)with acomponentFilterinstead.Resolves this configuration lazily. The resolve happens when the elements of the returnedFileCollectionget 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.- Parameters:
- dependencies- The dependencies for which the FileCollection should contain the files.
- Returns:
- The FileCollection with a subset of dependencies of this configuration.
- Implementation Requirements:
- Usage: This method should only be called on resolvable configurations and should fail if called on a configuration that does not permit this usage. It should warn if called on a configuration that has allowed this usage but marked it as deprecated.
 
- 
getResolvedConfigurationResolvedConfiguration getResolvedConfiguration()Returns aResolvedConfiguration, a legacy view of the results of dependency resolution. Avoid this method for new code. Prefer accessing resolution outputs viagetIncoming(). This API will be deprecated and removed in future Gradle versions.See ResolvedConfigurationfor details on why this API should not be used.- Returns:
- The ResolvedConfiguration object
- Implementation Requirements:
- Usage: This method should only be called on resolvable configurations and should fail if called on a configuration that does not permit this usage. It should warn if called on a configuration that has allowed this usage but marked it as deprecated.
 
- 
getUploadTaskNameDeprecated.This method will be removed in Gradle 9.0Returns a string. The returned value should not be interpreted as a task name, as no task with this name is created by default.- Returns:
- A string.
 
- 
getBuildDependenciesTaskDependency getBuildDependencies()Returns aTaskDependencyobject containing all required dependencies to build the local dependencies (e.g. project dependencies) belonging to this configuration or to one of its super configurations.- Specified by:
- getBuildDependenciesin interface- Buildable
- Returns:
- a TaskDependency object
- Implementation Requirements:
- Usage: This method should only be called on resolvable configurations, but will not warn if used otherwise.
 
- 
getTaskDependencyFromProjectDependencyReturns 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 configuration that depend on this one based on the useDependOn argument.- Parameters:
- useDependedOn- if true, add tasks from project dependencies in this configuration, otherwise use projects from configurations with the same name that depend on this one.
- taskName- name of task to depend on
- Returns:
- the populated TaskDependency object
 
- 
getDependenciesDependencySet getDependencies()Gets the set of declared dependencies directly contained in this configuration (ignoring superconfigurations).This method does not resolve the configuration. Therefore, the return value does not include transitive dependencies. - Returns:
- the set of dependencies
- See Also:
- Implementation Requirements:
- Usage: This method should only be called on declarable configurations, but will not warn if used otherwise.
 
- 
getAllDependenciesDependencySet getAllDependencies()Gets the complete set of declared dependencies including those contributed by superconfigurations.This method does not resolve the configuration. Therefore, the return value does not include transitive dependencies. - Returns:
- the (read-only) set of dependencies
- See Also:
 
- 
getDependencyConstraintsDependencyConstraintSet getDependencyConstraints()Gets the set of dependency constraints directly contained in this configuration (ignoring superconfigurations).- Returns:
- the set of dependency constraints
- Since:
- 4.6
- Implementation Requirements:
- Usage: This method should only be called on declarable configurations, but will not warn if used otherwise.
 
- 
getAllDependencyConstraintsDependencyConstraintSet getAllDependencyConstraints()Gets the complete set of dependency constraints including those contributed by superconfigurations. - Returns:
- the (read-only) set of dependency constraints
- Since:
- 4.6
 
- 
fromDependencyCollectorUse the given collector as a source for dependencies and dependency constraints.- Parameters:
- collector- the collector to use
- Since:
- 8.7
 
- 
getArtifactsPublishArtifactSet getArtifacts()Returns the artifacts of this configuration excluding the artifacts of extended configurations.- Returns:
- The set.
- Implementation Requirements:
- Usage: This method should only be called on consumable configurations, but will not warn if used otherwise.
 
- 
getAllArtifactsPublishArtifactSet getAllArtifacts()Returns the artifacts of this configuration including the artifacts of extended configurations.- Returns:
- The (read-only) set.
 
- 
getExcludeRulesSet<ExcludeRule> getExcludeRules()Returns the exclude rules applied for resolving any dependency of this configuration.- Returns:
- The exclude rules
- See Also:
 
- 
excludeAdds an exclude rule to exclude transitive dependencies for all dependencies of this configuration. You can also add exclude rules per-dependency. SeeModuleDependency.exclude(java.util.Map).- Parameters:
- excludeProperties- the properties to define the exclude rule.
- Returns:
- this
 
- 
defaultDependenciesExecute the given action if the configuration has no defined dependencies when it first participates in dependency resolution. AConfigurationwill participate in dependency resolution when:- The Configurationitself is resolved
- Another Configurationthat extends this one is resolved
- Another Configurationthat references this one as a project dependency is resolved
 configurations { conf } configurations['conf'].defaultDependencies { dependencies -> dependencies.add(owner.project.dependencies.create("org.gradle:my-util:1.0")) }A Configurationis considered empty even if it extends another, non-emptyConfiguration.If multiple actions are supplied, each action will be executed until the set of dependencies is no longer empty. Remaining actions will be ignored. - Parameters:
- action- the action to execute when the configuration has no defined dependencies.
- Returns:
- this
- Implementation Requirements:
- Usage: This method should only be called on declarable configurations and will emit a deprecation warning if called on a configuration that does not permit this usage, or has allowed this usage but marked it as deprecated.
 
- The 
- 
withDependenciesExecute the given action before the configuration first participates in dependency resolution. Actions will be executed in the order provided. A configuration will participate in dependency resolution when:- The Configurationitself is resolved
- The Configurationis published to a repository
- The Configurationis consumed as a variant by another project
- Another Configurationthat extends this one is resolved, published, or consumed
 In general, this method should be avoided in favor of other lazy APIs. However, in some cases where lazy APIs are not yet available, this method can be used to perform actions before the configuration is used. Despite the method's name, callbacks registered on this method should not add dependencies to the configuration or mutate the dependencies already present on the configuration. Instead, use the Provider-accepting methods onDependencySetandDependencyConstraintSet.Consider the following example that lazily adds a dependency to a configuration: configurations { conf } configurations['conf'].dependencies.addLater(provider { project.dependencies.create("com:example:1.0") })Similarly, instead of mutating an existing dependency, use dependency constraints instead. Consider the following example that uses a dependency constraint to prefer a specific version of a dependency if the dependency has not declared a preferred version itself. If the dependency has declared a version, the preferred version constraint will be ignored:configurations { conf } dependencies { conf("com:example") constraints { conf("com:example") { version { prefer("2.0") } } } }In some cases, using this method may still be necessary:- 
         Adding excludes: This method may be used to lazily add excludes to a Configuration.
         Adding excludes to declared dependencies should be handled with component metadata rules
- 
         Mutating configuration hierarchy: Mutating a configuration's hierarchy (extendsFrom(Configuration...)) after declaration is highly discouraged. However, doing so is possible with this method.
 - Parameters:
- action- a dependency action to execute before the configuration is used.
- Returns:
- this
- Since:
- 4.4
 
- The 
- 
getAllDeprecated.Returns all the configurations belonging to the same configuration container as this configuration (including this configuration).- Returns:
- All the configurations belonging to the configuration container that this set belongs to itself.
 
- 
getIncomingResolvableDependencies getIncoming()Returns aResolvableDependenciesinstance, exposing the results of dependency resolution. This method is the primary way to consume dependency resolution outputs.- Returns:
- An object that exposes the results of dependency resolution.
- Implementation Requirements:
- Usage: This method should only be called on consumable and resolvable configurations, but will not warn if used otherwise.
 
- 
getOutgoingConfigurationPublications getOutgoing()Returns the outgoingConfigurationPublicationsinstance that advertises and allows configuring the artifacts and variants published by this configuration.This allows adding additional artifacts and accessing and configuring variants to publish. - Returns:
- The outgoing publications object containing artifacts and variants published by this configuration.
- Since:
- 3.4
- Implementation Requirements:
- Usage: This method should only be called on consumable configurations, but will not warn if used otherwise.
 
- 
outgoingConfigures the outgoingConfigurationPublicationsinstance that advertises and allows configuring the artifacts and variants published by this configuration.- Parameters:
- action- The action to perform the configuration.
- Since:
- 3.4
- Implementation Requirements:
- Usage: This method should only be called on consumable configurations, but will not warn if used otherwise.
 
- 
copyConfiguration copy()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.This method is only intended for use for specific situations involving resolvable configuration, it is NOT intended as a general-purpose copying mechanism. - Returns:
- copy of this configuration
- Implementation Requirements:
- Usage: This method should only be called on resolvable configurations and will emit a deprecation warning if called on a configuration that does not permit this usage, or has allowed this usage but marked it as deprecated.
 
- 
copyRecursiveConfiguration 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.getHierarchy()for the copy will not include any superconfigurations.This method is only intended for use for specific situations involving resolvable configuration, it is NOT intended as a general-purpose copying mechanism. - Returns:
- copy of this configuration
- Implementation Requirements:
- Usage: This method should only be called on resolvable configurations and will emit a deprecation warning if called on a configuration that does not permit this usage, or has allowed this usage but marked it as deprecated.
 
- 
copyCreates a copy of this configuration ignoring superconfigurations (seecopy()but filtering the dependencies using the specified dependency spec.This method is only intended for use for specific situations involving resolvable configuration, it is NOT intended as a general-purpose copying mechanism. - Parameters:
- dependencySpec- filtering requirements
- Returns:
- copy of this configuration
- Implementation Requirements:
- Usage: This method should only be called on resolvable configurations and will emit a deprecation warning if called on a configuration that does not permit this usage, or has allowed this usage but marked it as deprecated.
 
- 
copyRecursiveCreates a copy of this configuration with dependencies from superconfigurations (seecopyRecursive()) but filtering the dependencies using the dependencySpec.This method is only intended for use for specific situations involving resolvable configuration, it is NOT intended as a general-purpose copying mechanism. - Parameters:
- dependencySpec- filtering requirements
- Returns:
- copy of this configuration
- Implementation Requirements:
- Usage: This method should only be called on resolvable configurations and will emit a deprecation warning if called on a configuration that does not permit this usage, or has allowed this usage but marked it as deprecated.
 
- 
copyTakes a closure which gets coerced into aSpec. Behaves otherwise in the same way ascopy(org.gradle.api.specs.Spec)This method is only intended for use for specific situations involving resolvable configuration, it is NOT intended as a general-purpose copying mechanism. - Parameters:
- dependencySpec- filtering requirements
- Returns:
- copy of this configuration
- Implementation Requirements:
- Usage: This method should only be called on resolvable configurations and will emit a deprecation warning if called on a configuration that does not permit this usage, or has allowed this usage but marked it as deprecated.
 
- 
copyRecursiveTakes a closure which gets coerced into aSpec. Behaves otherwise in the same way ascopyRecursive(org.gradle.api.specs.Spec)This method is only intended for use for specific situations involving resolvable configuration, it is NOT intended as a general-purpose copying mechanism. - Parameters:
- dependencySpec- filtering requirements
- Returns:
- copy of this configuration
- Implementation Requirements:
- Usage: This method should only be called on resolvable configurations and will emit a deprecation warning if called on a configuration that does not permit this usage, or has allowed this usage but marked it as deprecated.
 
- 
setCanBeConsumedvoid setCanBeConsumed(boolean allowed) Configures if a configuration can be consumed.- Since:
- 3.3
 
- 
isCanBeConsumedboolean isCanBeConsumed()Returns true if this configuration can be consumed from another project, or published. Defaults to true.- Returns:
- true if this configuration can be consumed or published.
- Since:
- 3.3
 
- 
setCanBeResolvedvoid setCanBeResolved(boolean allowed) Configures if a configuration can be resolved.- Since:
- 3.3
 
- 
isCanBeResolvedboolean isCanBeResolved()Returns true if it is allowed to query or resolve this configuration. Defaults to true.- Returns:
- true if this configuration can be queried or resolved.
- Since:
- 3.3
 
- 
setCanBeDeclaredConfigures if a configuration can have dependencies declared upon it.- Since:
- 8.2
 
- 
isCanBeDeclaredReturns true if it is allowed to declare dependencies upon this configuration. Defaults to true.- Returns:
- true if this configuration can have dependencies declared
- Since:
- 8.2
 
- 
shouldResolveConsistentlyWithTells that this configuration, when resolved, should resolve versions consistently from the resolution result of another resolvable configuration. For example, it's expected that the versions of the runtime classpath are the same as the versions from the compile classpath.- Parameters:
- versionsSource- another resolvable configuration to use as reference for versions
- Returns:
- this configuration
- Since:
- 6.8
- Implementation Requirements:
- Usage: This method should only be called on resolvable configurations and will emit a deprecation warning if called on a configuration that does not permit this usage, or has had allowed this usage but marked it as deprecated.
 
- 
disableConsistentResolutionDisables consistent resolution for this configuration.- Since:
- 6.8
- Implementation Requirements:
- Usage: This method should only be called on resolvable configurations and will emit a deprecation warning if called on a configuration that does not permit this usage, or has had allowed this usage but marked it as deprecated.
 
 
- 
Named.Namer.INSTANCEinstead (sinceConfigurationnow extendsNamed).