gradle
8.5

# withDependencies

abstract fun withDependencies(action: Action<out Any>): Configuration(source)

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

- The Configuration itself is resolved
- Another Configuration that extends this one is resolved
- Another Configuration that references this one as a project dependency is resolved

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 { require '1.0' }
             }
         }
    }

Content copied to clipboard
Actions will be executed in the order provided.

#### Return

this

#### Parameters

action

a dependency action to execute before the configuration is used.