public class Dependency extends java.lang.Object implements java.io.Serializable, java.lang.Cloneable, InputLocationTracker
<dependency>
element contains
information about a dependency
of the project.Modifier and Type | Field and Description |
---|---|
private java.lang.String |
artifactId
The unique id for an artifact produced by the
project group, e.g.
|
private InputLocation |
artifactIdLocation
Field artifactIdLocation.
|
private java.lang.String |
classifier
The classifier of the dependency.
|
private InputLocation |
classifierLocation
Field classifierLocation.
|
private java.util.List<Exclusion> |
exclusions
Field exclusions.
|
private InputLocation |
exclusionsLocation
Field exclusionsLocation.
|
private java.lang.String |
groupId
The project group that produced the dependency,
e.g.
|
private InputLocation |
groupIdLocation
Field groupIdLocation.
|
private InputLocation |
location
Field location.
|
private java.util.Map<java.lang.Object,InputLocation> |
locations
Field locations.
|
private java.lang.String |
managementKey |
private java.lang.String |
optional
Indicates the dependency is optional for use of
this library.
|
private InputLocation |
optionalLocation
Field optionalLocation.
|
private java.lang.String |
scope
The scope of the dependency -
compile , runtime ,
test , system , and
provided . |
private InputLocation |
scopeLocation
Field scopeLocation.
|
private java.lang.String |
systemPath
FOR SYSTEM SCOPE ONLY.
|
private InputLocation |
systemPathLocation
Field systemPathLocation.
|
private java.lang.String |
type
The type of dependency.
|
private InputLocation |
typeLocation
Field typeLocation.
|
private java.lang.String |
version
The version of the dependency, e.g.
|
private InputLocation |
versionLocation
Field versionLocation.
|
Constructor and Description |
---|
Dependency() |
Modifier and Type | Method and Description |
---|---|
void |
addExclusion(Exclusion exclusion)
Method addExclusion.
|
Dependency |
clone()
Method clone.
|
java.lang.String |
getArtifactId()
Get the unique id for an artifact produced by the project
group, e.g.
|
java.lang.String |
getClassifier()
Get the classifier of the dependency.
|
java.util.List<Exclusion> |
getExclusions()
Method getExclusions.
|
java.lang.String |
getGroupId()
Get the project group that produced the dependency, e.g.
|
InputLocation |
getLocation(java.lang.Object key)
Gets the location of the specified field in the input
source.
|
java.lang.String |
getManagementKey() |
java.lang.String |
getOptional()
Get indicates the dependency is optional for use of this
library.
|
private InputLocation |
getOtherLocation(java.lang.Object key) |
java.lang.String |
getScope()
Get the scope of the dependency -
compile ,
runtime ,
test , system , and
provided . |
java.lang.String |
getSystemPath()
Get fOR SYSTEM SCOPE ONLY.
|
java.lang.String |
getType()
Get the type of dependency.
|
java.lang.String |
getVersion()
Get the version of the dependency, e.g.
|
boolean |
isOptional() |
void |
removeExclusion(Exclusion exclusion)
Method removeExclusion.
|
void |
setArtifactId(java.lang.String artifactId)
Set the unique id for an artifact produced by the project
group, e.g.
|
void |
setClassifier(java.lang.String classifier)
Set the classifier of the dependency.
|
void |
setExclusions(java.util.List<Exclusion> exclusions)
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(java.lang.String groupId)
Set the project group that produced the dependency, e.g.
|
void |
setLocation(java.lang.Object key,
InputLocation location)
Sets the location of the specified field.
|
void |
setOptional(boolean optional) |
void |
setOptional(java.lang.String optional)
Set indicates the dependency is optional for use of this
library.
|
void |
setOtherLocation(java.lang.Object key,
InputLocation location) |
void |
setScope(java.lang.String scope)
Set the scope of the dependency -
compile ,
runtime ,
test , system , and
provided . |
void |
setSystemPath(java.lang.String systemPath)
Set fOR SYSTEM SCOPE ONLY.
|
void |
setType(java.lang.String type)
Set the type of dependency.
|
void |
setVersion(java.lang.String version)
Set the version of the dependency, e.g.
|
java.lang.String |
toString() |
private java.lang.String groupId
org.apache.maven
.private java.lang.String artifactId
maven-artifact
.private java.lang.String version
3.2.1
. In Maven 2, this can also be
specified as a range of versions.private java.lang.String type
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.private java.lang.String classifier
sources
and javadoc
:
see default artifact
handlers for a list,jdk14
and
jdk15
.private java.lang.String scope
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. The default scope is
compile
.private java.lang.String systemPath
${java.home}
.private java.util.List<Exclusion> exclusions
private java.lang.String optional
String
for
technical reasons, the semantic type is actually
Boolean
. Default value is
false
.private java.util.Map<java.lang.Object,InputLocation> locations
private InputLocation location
private InputLocation groupIdLocation
private InputLocation artifactIdLocation
private InputLocation versionLocation
private InputLocation typeLocation
private InputLocation classifierLocation
private InputLocation scopeLocation
private InputLocation systemPathLocation
private InputLocation exclusionsLocation
private InputLocation optionalLocation
private java.lang.String managementKey
public void addExclusion(Exclusion exclusion)
exclusion
- public Dependency clone()
clone
in class java.lang.Object
public java.lang.String getArtifactId()
maven-artifact
.public java.lang.String getClassifier()
sources
and javadoc
:
see default artifact
handlers for a list,jdk14
and
jdk15
.public java.util.List<Exclusion> getExclusions()
public java.lang.String getGroupId()
org.apache.maven
.public InputLocation getLocation(java.lang.Object key)
InputLocationTracker
getLocation
in interface InputLocationTracker
key
- public java.lang.String getOptional()
String
for
technical reasons, the semantic type is actually
Boolean
. Default value is
false
.public void setLocation(java.lang.Object key, InputLocation location)
InputLocationTracker
setLocation
in interface InputLocationTracker
key
- location
- public void setOtherLocation(java.lang.Object key, InputLocation location)
key
- location
- private InputLocation getOtherLocation(java.lang.Object key)
key
- public java.lang.String getScope()
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. The default scope is
compile
.public java.lang.String getSystemPath()
${java.home}
.public java.lang.String getType()
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 java.lang.String getVersion()
3.2.1
.
In Maven 2, this can also be
specified as a range of versions.public void removeExclusion(Exclusion exclusion)
exclusion
- public void setArtifactId(java.lang.String artifactId)
maven-artifact
.artifactId
- public void setClassifier(java.lang.String classifier)
sources
and javadoc
:
see default artifact
handlers for a list,jdk14
and
jdk15
.classifier
- public void setExclusions(java.util.List<Exclusion> exclusions)
exclusions
- public void setGroupId(java.lang.String groupId)
org.apache.maven
.groupId
- public void setOptional(java.lang.String optional)
String
for
technical reasons, the semantic type is actually
Boolean
. Default value is
false
.optional
- public void setScope(java.lang.String scope)
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. The default scope is
compile
.scope
- public void setSystemPath(java.lang.String systemPath)
${java.home}
.systemPath
- public void setType(java.lang.String type)
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(java.lang.String version)
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 java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public java.lang.String getManagementKey()
groupId:artifactId:type