api / org.gradle.api.artifacts / Configuration / withDependencies

withDependencies

@Incubating abstract fun withDependencies(action: Action<in DependencySet>): Configuration

Execute the given action before the configuration first participates in dependency resolution. A Configuration will participate in dependency resolution when:

This method is useful for mutating the dependencies for a configuration:
 configurations { conf } configurations['conf'].withDependencies { dependencies -> dependencies.each { dependency -> if (dependency.version == null) { dependency.version { prefer '1.0' } } } } 
Actions will be executed in the order provided.

Parameters

action - a dependency action to execute before the configuration is used.

Since
4.4

Return
this