# ModuleDependency

interface ModuleDependency : Dependency, HasConfigurableAttributes<SELF> (source)

A `ModuleDependency` is a org.gradle.api.artifacts.Dependency on a module outside the current project.

For examples on configuring the exclude rules please refer to exclude.

#### Inheritors

ProjectDependency
ExternalDependency

## Properties

ARCHIVES_CONFIGURATION
Link copied to clipboard
val ARCHIVES_CONFIGURATION: String = "archives"
CLASSIFIER
Link copied to clipboard
val CLASSIFIER: String = "m:classifier"
DEFAULT_CONFIGURATION
Link copied to clipboard
val DEFAULT_CONFIGURATION: String = "default"

## Functions

addArtifact
Link copied to clipboard
abstract fun addArtifact(artifact: DependencyArtifact): ModuleDependency
Adds an artifact to this dependency.
artifact
Link copied to clipboard
abstract fun artifact(@DelegatesTo(value = DependencyArtifact::class, strategy = 1) configureClosure: Closure): DependencyArtifact
abstract fun artifact(configureAction: Action<in DependencyArtifact>): DependencyArtifact
Adds an artifact to this dependency.
attributes
Link copied to clipboard
abstract fun attributes(configureAction: Action<in AttributeContainer>): ModuleDependency
Mutates the attributes of this dependency.
because
Link copied to clipboard
abstract fun because(reason: String)
capabilities
Link copied to clipboard
abstract fun capabilities(configureAction: Action<in ModuleDependencyCapabilitiesHandler>): ModuleDependency
Configures the requested capabilities of this dependency.
contentEquals
Link copied to clipboard
abstract fun contentEquals(dependency: Dependency): Boolean
copy
Link copied to clipboard
abstract fun copy(): ModuleDependency
doNotEndorseStrictVersions
Link copied to clipboard
abstract fun doNotEndorseStrictVersions()
Resets the isEndorsingStrictVersions state of this dependency.
endorseStrictVersions
Link copied to clipboard
abstract fun endorseStrictVersions()
Endorse version constraints with getStrictVersion strict versions} from the target module.
exclude
Link copied to clipboard
abstract fun exclude(excludeProperties: Map<String, String>): ModuleDependency
Adds an exclude rule to exclude transitive dependencies of this dependency.
getArtifacts
Link copied to clipboard
abstract fun getArtifacts(): Set<DependencyArtifact>
Returns the artifacts belonging to this dependency.
getAttributes
Link copied to clipboard
abstract fun getAttributes(): AttributeContainer
Returns the attributes for this dependency.
getExcludeRules
Link copied to clipboard
abstract fun getExcludeRules(): Set<ExcludeRule>
Returns the exclude rules for this dependency.
getGroup
Link copied to clipboard
abstract fun getGroup(): String
getName
Link copied to clipboard
abstract fun getName(): String
getReason
Link copied to clipboard
abstract fun getReason(): String
getRequestedCapabilities
Link copied to clipboard
abstract fun getRequestedCapabilities(): List<Capability>
Returns the set of requested capabilities for this dependency.
getTargetConfiguration
Link copied to clipboard
@Nullable
abstract fun getTargetConfiguration(): String
Returns the requested target configuration of this dependency.
getVersion
Link copied to clipboard
abstract fun getVersion(): String
isEndorsingStrictVersions
Link copied to clipboard
abstract fun isEndorsingStrictVersions(): Boolean
Are the getStrictVersion strict version} dependency constraints of the target module endorsed?
isTransitive
Link copied to clipboard
abstract fun isTransitive(): Boolean
Returns whether this dependency should be resolved including or excluding its transitive dependencies.
setTargetConfiguration
Link copied to clipboard
abstract fun setTargetConfiguration(@Nullable name: String)
Sets the requested target configuration of this dependency.
setTransitive
Link copied to clipboard
abstract fun setTransitive(transitive: Boolean): ModuleDependency
Sets whether this dependency should be resolved including or excluding its transitive dependencies.