public class Dependency extends Objectimplements Serializable , Cloneable , InputLocationTracker
<dependency> element contains information about a dependency of the project.
| Constructor and Description |
|---|
Dependency()
|
| Modifier and Type | Method and Description |
|---|---|
void |
addExclusion(Exclusion
Method addExclusion.
|
Dependency |
clone()
Method clone.
|
String |
getArtifactId()
Get the unique id for an artifact produced by the project group, e.g.
|
String |
getClassifier()
Get the classifier of the dependency.
|
List |
getExclusions()
Method getExclusions.
|
String |
getGroupId()
Get the project group that produced the dependency, e.g.
|
InputLocation |
getLocation(Object
Gets the location of the specified field in the input source.
|
String |
getManagementKey()
|
String |
getOptional()
Get indicates the dependency is optional for use of this library.
|
String |
getScope()
Get the scope of the dependency -
compile,
runtime,
test,
system, and
provided.
|
String |
getSystemPath()
Get fOR SYSTEM SCOPE ONLY.
|
String |
getType()
Get the type of dependency.
|
String |
getVersion()
Get the version of the dependency, e.g.
|
boolean |
isOptional()
|
void |
removeExclusion(Exclusion
Method removeExclusion.
|
void |
setArtifactId(String
Set the unique id for an artifact produced by the project group, e.g.
|
void |
setClassifier(String
Set the classifier of the dependency.
|
void |
setExclusions(List
Set lists a set of artifacts that should be excluded from this dependency's artifact list when it comes to calculating transitive dependencies.
|
void |
setGroupId(String
Set the project group that produced the dependency, e.g.
|
void |
setLocation(Object
Sets the location of the specified field.
|
void |
setOptional(boolean optional)
|
void |
setOptional(String
Set indicates the dependency is optional for use of this library.
|
void |
setScope(String
Set the scope of the dependency -
compile,
runtime,
test,
system, and
provided.
|
void |
setSystemPath(String
Set fOR SYSTEM SCOPE ONLY.
|
void |
setType(String
Set the type of dependency.
|
void |
setVersion(String
Set the version of the dependency, e.g.
|
String |
toString()
|
public void addExclusion(Exclusionexclusion)
exclusion -
public Dependencyclone()
public StringgetArtifactId()
maven-artifact.
public StringgetClassifier()
sources and javadoc: see default artifact handlers for a list,jdk14 and jdk15.public StringgetGroupId()
org.apache.maven.
public InputLocationgetLocation(Object key)
InputLocationTracker
getLocation in interface
InputLocationTracker
key -
public StringgetOptional()
String for technical reasons, the semantic type is actually
Boolean. Default value is
false.
public StringgetScope()
compile,
runtime,
test,
system, and
provided. Used to calculate the various classpaths used for compilation, testing, and so on. It also assists in determining which artifacts to include in a distribution of this project. For more information, see
the dependency mechanism.
public StringgetSystemPath()
${java.home}.
public StringgetType()
jar,
war,
ejb-client and
test-jar: see
default artifact handlers for a list. New types can be defined by plugins that set
extensions to
true, so this is not a complete list.
public StringgetVersion()
3.2.1. In Maven 2, this can also be specified as a range of versions.
public void removeExclusion(Exclusionexclusion)
exclusion -
public void setArtifactId(StringartifactId)
maven-artifact.
artifactId -
public void setClassifier(Stringclassifier)
sources and javadoc: see default artifact handlers for a list,jdk14 and jdk15.classifier -
public void setExclusions(List<Exclusion > exclusions)
exclusions -
public void setGroupId(StringgroupId)
org.apache.maven.
groupId -
public void setLocation(Objectkey, InputLocation location)
InputLocationTracker
setLocation in interface
InputLocationTracker
key -
location -
public void setOptional(Stringoptional)
String for technical reasons, the semantic type is actually
Boolean. Default value is
false.
optional -
public void setScope(Stringscope)
compile,
runtime,
test,
system, and
provided. Used to calculate the various classpaths used for compilation, testing, and so on. It also assists in determining which artifacts to include in a distribution of this project. For more information, see
the dependency mechanism.
scope -
public void setSystemPath(StringsystemPath)
${java.home}.
systemPath -
public void setType(Stringtype)
jar,
war,
ejb-client and
test-jar: see
default artifact handlers for a list. New types can be defined by plugins that set
extensions to
true, so this is not a complete list.
type -
public void setVersion(Stringversion)
3.2.1. In Maven 2, this can also be specified as a range of versions.
version -
public boolean isOptional()
public void setOptional(boolean optional)
public StringtoString()
toString in class
Object
Object.toString()
public StringgetManagementKey()
groupId:artifactId:type