public final class Dependency extends Object
| Constructor and Description |
|---|
Dependency(Artifact artifact,
String scope)
Creates a mandatory dependency on the specified artifact with the given scope.
|
Dependency(Artifact artifact,
String scope,
boolean optional)
Creates a dependency on the specified artifact with the given scope.
|
Dependency(Artifact artifact,
String scope,
boolean optional,
Collection<Exclusion> exclusions)
Creates a dependency on the specified artifact with the given scope and exclusions.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
Artifact |
getArtifact()
Gets the artifact being depended on.
|
Collection<Exclusion> |
getExclusions()
Gets the exclusions for this dependency.
|
String |
getScope()
Gets the scope of the dependency.
|
int |
hashCode() |
boolean |
isOptional()
Indicates whether this dependency is optional or not.
|
Dependency |
setArtifact(Artifact artifact)
Sets the artifact being depended on.
|
Dependency |
setExclusions(Collection<Exclusion> exclusions)
Sets the exclusions for the dependency.
|
Dependency |
setOptional(boolean optional)
Sets the optional flag for the dependency.
|
Dependency |
setScope(String scope)
Sets the scope of the dependency, e.g.
|
String |
toString() |
public Dependency(Artifact artifact, String scope)
artifact - The artifact being depended on, must not be null.scope - The scope of the dependency, may be null.public Dependency(Artifact artifact, String scope, boolean optional)
artifact - The artifact being depended on, must not be null.scope - The scope of the dependency, may be null.optional - A flag whether the dependency is optional or mandatory.public Dependency(Artifact artifact, String scope, boolean optional, Collection<Exclusion> exclusions)
artifact - The artifact being depended on, must not be null.scope - The scope of the dependency, may be null.optional - A flag whether the dependency is optional or mandatory.exclusions - The exclusions that apply to transitive dependencies, may be null if none.public Artifact getArtifact()
null.public Dependency setArtifact(Artifact artifact)
artifact - The artifact, must not be null.null.public String getScope()
null.public Dependency setScope(String scope)
scope - The scope of the dependency, may be null.null.public boolean isOptional()
true if the dependency is optional, false otherwise.public Dependency setOptional(boolean optional)
optional - true if the dependency is optional, false if the dependency is mandatory.null.public Collection<Exclusion> getExclusions()
null.public Dependency setExclusions(Collection<Exclusion> exclusions)
exclusions - The exclusions, may be null.null.Copyright © 2010-2012 Sonatype, Inc.. All Rights Reserved.