# classpath

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

Adds a dependency to the script classpath.

#### Return

The dependency.

#### Parameters

dependencyNotation

notation for the dependency to be added.

#### See also

DependencyHandler.add

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

Adds a dependency to the script classpath.

#### Return

The dependency.

#### 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)
fun DependencyHandler.classpath(dependencyNotation: ProviderConvertible<MinimalExternalModuleDependency>, dependencyConfiguration: ExternalModuleDependency.() -> Unit)

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

Adds a dependency to the script classpath.

#### Return

The dependency.

#### Parameters

dependency

dependency to be added.

dependencyConfiguration

expression to use to configure the dependency.

#### See also

DependencyHandler.add

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

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?

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>

The script classpath configuration.

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

### Deprecated

Use single-string notation instead

Adds a dependency to the script classpath.

#### Return

The dependency.

#### 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

### Deprecated

Use single-string notation instead

Adds a dependency to the script classpath.

#### Return

The dependency.

#### 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