Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD

## org.gradle.api.artifacts
Interface ModuleDependency

    org.gradle.api.artifacts.Dependency
      org.gradle.api.artifacts.ModuleDependency

All Superinterfaces:
  Dependency

    interface ModuleDependency
    extends Dependency

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

A module dependency is an entity. Its key consists of the fields `group, name, version, configuration`.

Method Summary
`ModuleDependency` | `addArtifact(DependencyArtifact artifact)` Adds an artifact to this dependency.
`ModuleDependency` | `copy()` {
`ModuleDependency` | `exclude(Map excludeProperties)` Adds an exclude rule to exclude transitive dependencies of this dependency.
`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).
`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

### addArtifact

    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.
  return:
    this

### copy

    public ModuleDependency copy()

  {@inheritDoc}

### exclude

    public ModuleDependency exclude(Map excludeProperties)

  Adds an exclude rule to exclude transitive dependencies of this dependency. You can also add exclude rules per-configuration. See Configuration#getExcludeRules().
  param:
    excludeProperties the properties to define the exclude rule.
  return:
    this

### getArtifacts

    public Set getArtifacts()

  Returns the artifacts belonging to this dependency.
  see:
    #addArtifact(DependencyArtifact)

### getConfiguration

    public java.lang.String getConfiguration()

  Returns the configuration of this dependency module (not the configurations this dependency belongs too). Never returns null. The default value for the configuration is #DEFAULT_CONFIGURATION. A dependency source might have multiple configurations. Every configuration represents a different set of artifacts and dependencies for this dependency module.

### getExcludeRules

    public Set getExcludeRules()

  Returns the exclude rules for this dependency.
  see:
    #exclude(java.util.Map)

### isTransitive

    public boolean isTransitive()

  Returns whether this dependency should be resolved including or excluding its transitive dependencies.
  see:
    #setTransitive(boolean)

### setTransitive

    public ModuleDependency setTransitive(boolean transitive)

  Sets whether this dependency should be resolved including or excluding its transitive dependencies. The artifacts belonging to this dependency might themselve have dependencies on other artifacts. The latter are called transitive dependencies.
  param:
    transitive Whether transitive dependencies should be resolved.
  return:
    this

Groovy Documentation