# exclude

fun Configuration.exclude(group: String? = null, module: String? = null): Configuration(source)

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.

#### Return

this

#### Since

4.1

#### Parameters

group

the optional group identifying the dependencies to be excluded.

module

the optional module name identifying the dependencies to be excluded.

fun <T : ModuleDependency> T.exclude(group: String? = null, module: String? = null): T(source)

Adds an exclude rule to exclude transitive dependencies of this dependency.

Excluding a particular transitive dependency does not guarantee that it does not show up in the dependencies of a given configuration. For example, some other dependency, which does not have any exclude rules, might pull in exactly the same transitive dependency. To guarantee that the transitive dependency is excluded from the entire configuration please use per-configuration exclude rules: Configuration.getExcludeRules. In fact, in majority of cases the actual intention of configuring per-dependency exclusions is really excluding a dependency from the entire configuration (or classpath).

If your intention is to exclude a particular transitive dependency because you don't like the version it pulls in to the configuration then consider using the forced versions feature: ResolutionStrategy.force.

#### Return

this

#### Since

4.1

#### Parameters

group

the optional group identifying the dependencies to be excluded.

module

the optional module name identifying the dependencies to be excluded.

#### See also

ModuleDependency.exclude