interface ModuleDependency : Dependency, HasConfigurableAttributes<ModuleDependency>
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(java.util.Map)
.
static val ARCHIVES_CONFIGURATION: String |
|
static val CLASSIFIER: String |
|
static val DEFAULT_CONFIGURATION: String |
abstract fun addArtifact(artifact: DependencyArtifact): ModuleDependency
Adds an artifact to this dependency. If no artifact is added to a dependency, an implicit default artifact is used. This default artifact has the same name as the module and its type and extension is jar. If at least one artifact is explicitly added, the implicit default artifact won't be used any longer. |
|
abstract fun artifact(configureClosure: Closure<Any>): DependencyArtifact
Adds an artifact to this dependency. The given closure is passed a instance, which it can configure. If no artifact is added to a dependency, an implicit default artifact is used. This default artifact has the same name as the module and its type and extension is jar. If at least one artifact is explicitly added, the implicit default artifact won't be used any longer. abstract fun artifact(configureAction: Action<in DependencyArtifact>): DependencyArtifact
Adds an artifact to this dependency. The given action is passed a instance, which it can configure. If no artifact is added to a dependency, an implicit default artifact is used. This default artifact has the same name as the module and its type and extension is jar. If at least one artifact is explicitly added, the implicit default artifact won't be used any longer. |
|
abstract fun attributes(configureAction: Action<in AttributeContainer>): ModuleDependency
Mutates the attributes of this dependency. Attributes are used during dependency resolution to select the appropriate target variant, in particular when a single component provides different variants. |
|
abstract fun copy(): ModuleDependency
{@inheritDoc} |
|
abstract fun exclude(excludeProperties: MutableMap<String, String>): ModuleDependency
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: 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 forced versions' feature:
|
|
abstract fun getArtifacts(): MutableSet<DependencyArtifact>
Returns the artifacts belonging to this dependency. |
|
abstract fun getAttributes(): AttributeContainer
Returns the attributes for this dependency. Mutation of the attributes of a dependency must be done through the |
|
abstract fun getExcludeRules(): MutableSet<ExcludeRule>
Returns the exclude rules for this dependency. |
|
abstract fun getTargetConfiguration(): String
Returns the requested target configuration of this dependency. This is the name of the configuration in the target module that should be used when selecting the matching configuration. If |
|
abstract fun isTransitive(): Boolean
Returns whether this dependency should be resolved including or excluding its transitive dependencies. |
|
abstract fun setTargetConfiguration(name: String): Unit
Sets the requested target configuration of this dependency. This is the name of the configuration in the target module that should be used when selecting the matching configuration. If |
|
abstract fun setTransitive(transitive: Boolean): ModuleDependency
Sets whether this dependency should be resolved including or excluding its transitive dependencies. The artifacts belonging to this dependency might themselves have dependencies on other artifacts. The latter are called transitive dependencies. |
abstract fun because(reason: String): Unit
Sets the reason why this dependency should be used. |
|
abstract fun contentEquals(dependency: Dependency): Boolean
Returns whether two dependencies have identical values for their properties. A dependency is an entity with a key. Therefore dependencies might be equal and yet have different properties. |
|
abstract fun getGroup(): String
Returns the group of this dependency. The group is often required to find the artifacts of a dependency in a repository. For example, the group name corresponds to a directory name in a Maven like repository. Might return null. |
|
abstract fun getName(): String
Returns the name of this dependency. The name is almost always required to find the artifacts of a dependency in a repository. Never returns null. |
|
abstract fun getReason(): String
Returns a reason why this dependency should be used, in particular with regards to its version. The dependency report will use it to explain why a specific dependency was selected, or why a specific dependency version was used. |
|
abstract fun getVersion(): String
Returns the version of this dependency. The version is often required to find the artifacts of a dependency in a repository. For example the version name corresponds to a directory name in a Maven like repository. Might return null. |
fun <T : ModuleDependency> T.exclude(group: String? = null, module: String? = null): T
Adds an exclude rule to exclude transitive dependencies of this dependency. |
interface ExternalDependency : ModuleDependency, ModuleVersionSelector
An |
|
interface ProjectDependency : ModuleDependency, SelfResolvingDependency
A |