api / org.gradle.api.artifacts / DependencyConstraintMetadata

DependencyConstraintMetadata

@Incubating interface DependencyConstraintMetadata : DependencyMetadata<DependencyConstraintMetadata>

Describes a dependency constraint declared in a resolved component's metadata, which typically originates from a component descriptor (Gradle metadata file). This interface can be used to adjust a dependency constraint's properties via metadata rules (see org.gradle.api.artifacts.dsl.ComponentMetadataHandler.

Since
4.5

Inherited Functions

attributes

abstract fun attributes(configureAction: Action<in AttributeContainer>): SELF

Adjust the attributes of this dependency

because

abstract fun because(reason: String): SELF

Adjust the reason why this dependency should be selected.

getAttributes

abstract fun getAttributes(): AttributeContainer

Returns the attributes of this dependency.

getGroup

abstract fun getGroup(): String

Returns the group of the module that is targeted by this dependency or dependency constraint. The group allows the definition of modules of the same name in different organizations or contexts.

getModule

abstract fun getModule(): ModuleIdentifier

The module identifier of the component. Returns the same information as #getGroup() and #getName().

getName

abstract fun getName(): String

Returns the name of the module that is targeted by this dependency or dependency constraint.

getReason

abstract fun getReason(): String

Returns the reason why this dependency should be selected.

getVersionConstraint

abstract fun getVersionConstraint(): VersionConstraint

Returns the version of the module that is targeted by this dependency or dependency constraint. which usually expresses what API level of the module you are compatible with.

version

abstract fun version(configureAction: Action<in MutableVersionConstraint>): SELF

Adjust the version constraints of the dependency or dependency constraint.