|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD |
org.gradle.api.artifacts.Dependency org.gradle.api.artifacts.ModuleDependency
public interface ModuleDependency extends Dependency
A ModuleDependency is a Dependency on a module outside the current project.
A module dependency is an entity. Its key consists of the fields group, name, version, configuration.
Field Summary |
---|
Fields inherited from interface Dependency | |
---|---|
ARCHIVES_CONFIGURATION, CLASSIFIER, DEFAULT_CONFIGURATION |
Method Summary | |
---|---|
ModuleDependency
|
addArtifact(DependencyArtifact artifact)
|
DependencyArtifact
|
artifact(groovy.lang.Closure configureClosure)
|
ModuleDependency
|
copy()
{@inheritDoc} |
ModuleDependency
|
exclude(java.util.Map excludeProperties)
Adds an exclude rule to exclude transitive dependencies of this dependency. |
java.util.Set
|
getArtifacts()
Returns the artifacts belonging to this dependency. |
java.lang.String
|
getConfiguration()
Returns the configuration of this dependency module (not the configurations this dependency belongs too). |
java.util.Set
|
getExcludeRules()
Returns the exclude rules for this dependency. |
boolean
|
isTransitive()
Returns whether this dependency should be resolved including or excluding its transitive dependencies. |
ModuleDependency
|
setTransitive(boolean transitive)
Sets whether this dependency should be resolved including or excluding its transitive dependencies. |
Methods inherited from interface Dependency | |
---|---|
contentEquals, copy, getGroup, getName, getVersion |
Method Detail |
---|
public ModuleDependency addArtifact(DependencyArtifact artifact)
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.
public DependencyArtifact artifact(groovy.lang.Closure configureClosure)
Adds an artifact to this dependency. The given closure is passed a DependencyArtifact 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.
public ModuleDependency copy()
public ModuleDependency exclude(java.util.Map excludeProperties)
excludeProperties
- the properties to define the exclude rule.
public java.util.Set getArtifacts()
public java.lang.String getConfiguration()
public java.util.Set getExcludeRules()
public boolean isTransitive()
public ModuleDependency setTransitive(boolean transitive)
transitive
- Whether transitive dependencies should be resolved.
Groovy Documentation