# classpath

fun DependencyHandler. classpath(dependencyNotation: Any): Dependency?(source)

Adds a dependency to the script classpath.

#### Return

The dependency.

#### Since

4.1

#### Parameters

dependencyNotation

notation for the dependency to be added.

#### See also

DependencyHandler.add

inline fun DependencyHandler. classpath(dependencyNotation: String, dependencyConfiguration: ExternalModuleDependency.() -> Unit): ExternalModuleDependency(source)

Adds a dependency to the script classpath.

#### Return

The dependency.

#### Since

4.10.1

#### Parameters

dependencyNotation

notation for the dependency to be added.

dependencyConfiguration

expression to use to configure the dependency.

#### See also

DependencyHandler.add

fun DependencyHandler. classpath(dependencyNotation: Provider<MinimalExternalModuleDependency>, dependencyConfiguration: ExternalModuleDependency.() -> Unit)(source)
fun DependencyHandler. classpath(dependencyNotation: ProviderConvertible<MinimalExternalModuleDependency>, dependencyConfiguration: ExternalModuleDependency.() -> Unit)(source)

Adds a dependency to the script classpath.

#### Return

The dependency.

#### Since

7.4

#### Parameters

dependencyNotation

notation for the dependency to be added.

dependencyConfiguration

expression to use to configure the dependency.

#### See also

DependencyHandler.add

inline fun <T : ModuleDependency> DependencyHandler. classpath(dependency: T, dependencyConfiguration: T.() -> Unit): T(source)

Adds a dependency to the script classpath.

#### Return

The dependency.

#### Since

4.10.1

#### Parameters

dependency

dependency to be added.

dependencyConfiguration

expression to use to configure the dependency.

#### See also

DependencyHandler.add

fun DependencyConstraintHandler. classpath(dependencyConstraintNotation: Any): DependencyConstraint?(source)

Adds a dependency constraint to the script classpath configuration.

#### Return

the added dependency constraint

#### Since

5.0

#### Parameters

dependencyConstraintNotation

the dependency constraint notation

#### See also

DependencyConstraintHandler.add

fun DependencyConstraintHandler. classpath(dependencyConstraintNotation: Any, configuration: DependencyConstraint.() -> Unit): DependencyConstraint?(source)

Adds a dependency constraint to the script classpath configuration.

#### Return

the added dependency constraint

#### Since

5.0

#### Parameters

dependencyConstraintNotation

the dependency constraint notation

configuration

the block to use to configure the dependency constraint

#### See also

DependencyConstraintHandler.add

val NamedDomainObjectContainer<Configuration>.classpath: NamedDomainObjectProvider<Configuration>(source)

The script classpath configuration.

#### Since

5.0

fun DependencyHandler. classpath(group: String, name: String, version: String? = null, configuration: String? = null, classifier: String? = null, ext: String? = null): ExternalModuleDependency(source)

### Deprecated

Use single-string notation or DependencyFactory instead

Adds a dependency to the script classpath.

#### Return

The dependency.

#### Since

4.10.1

#### Parameters

group

the group of the module to be added as a dependency.

name

the name of the module to be added as a dependency.

version

the optional version of the module to be added as a dependency.

configuration

the optional configuration of the module to be added as a dependency.

classifier

the optional classifier of the module artifact to be added as a dependency.

ext

the optional extension of the module artifact to be added as a dependency.

#### See also

DependencyHandler.add

inline fun DependencyHandler. classpath(group: String, name: String, version: String? = null, configuration: String? = null, classifier: String? = null, ext: String? = null, dependencyConfiguration: ExternalModuleDependency.() -> Unit): ExternalModuleDependency(source)

### Deprecated

Use single-string notation or DependencyFactory instead

Adds a dependency to the script classpath.

#### Return

The dependency.

#### Since

4.10.1

#### Parameters

group

the group of the module to be added as a dependency.

name

the name of the module to be added as a dependency.

version

the optional version of the module to be added as a dependency.

configuration

the optional configuration of the module to be added as a dependency.

classifier

the optional classifier of the module artifact to be added as a dependency.

ext

the optional extension of the module artifact to be added as a dependency.

dependencyConfiguration

expression to use to configure the dependency.

#### See also

DependencyHandler.create
DependencyHandler.add