public class Dependency extends Object implements 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 exclusion)
Method addExclusion.
|
void |
clearManagementKey()
Clears the management key in case one field has been modified.
|
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<Exclusion> |
getExclusions()
Method getExclusions.
|
String |
getGroupId()
Get the project group that produced the dependency, e.g.
|
InputLocation |
getLocation(Object key)
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, that will be mapped to a file
extension, an optional classifier, and a few other
attributes.
|
String |
getVersion()
Get the version of the dependency, e.g.
|
boolean |
isOptional() |
void |
removeExclusion(Exclusion exclusion)
Method removeExclusion.
|
void |
setArtifactId(String artifactId)
Set the unique id for an artifact produced by the project
group, e.g.
|
void |
setClassifier(String classifier)
Set the classifier of the dependency.
|
void |
setExclusions(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(String groupId)
Set the project group that produced the dependency, e.g.
|
void |
setLocation(Object key,
InputLocation location)
Sets the location of the specified field.
|
void |
setOptional(boolean optional) |
void |
setOptional(String optional)
Set indicates the dependency is optional for use of this
library.
|
void |
setOtherLocation(Object key,
InputLocation location) |
void |
setScope(String scope)
Set the scope of the dependency -
compile ,
runtime ,
test , system , and
provided . |
void |
setSystemPath(String systemPath)
Set fOR SYSTEM SCOPE ONLY.
|
void |
setType(String type)
Set the type of dependency, that will be mapped to a file
extension, an optional classifier, and a few other
attributes.
|
void |
setVersion(String version)
Set the version of the dependency, e.g.
|
String |
toString() |
public void addExclusion(Exclusion exclusion)
exclusion
- public Dependency clone()
public String getArtifactId()
maven-artifact
.public String getClassifier()
sources
and javadoc
:
see default artifact
handlers for a list,jdk14
and
jdk15
.public String getGroupId()
org.apache.maven
.public InputLocation getLocation(Object key)
InputLocationTracker
getLocation
in interface InputLocationTracker
key
- public String getOptional()
String
for
technical reasons, the semantic type is actually
Boolean
. Default value is
false
.public void setLocation(Object key, InputLocation location)
InputLocationTracker
setLocation
in interface InputLocationTracker
key
- location
- public void setOtherLocation(Object key, InputLocation location)
key
- location
- public 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 String getSystemPath()
${java.home}
.public String getType()
jar
,
war
, ejb-client
and test-jar
: see default
artifact handlers for a list. New types can
be defined by extensions, so this is not a complete list.public 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(String artifactId)
maven-artifact
.artifactId
- public void setClassifier(String classifier)
sources
and javadoc
:
see default artifact
handlers for a list,jdk14
and
jdk15
.classifier
- public void setExclusions(List<Exclusion> exclusions)
exclusions
- public void setGroupId(String groupId)
org.apache.maven
.groupId
- public void setOptional(String optional)
String
for
technical reasons, the semantic type is actually
Boolean
. Default value is
false
.optional
- public void setScope(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(String systemPath)
${java.home}
.systemPath
- public void setType(String type)
jar
,
war
, ejb-client
and test-jar
: see default
artifact handlers for a list. New types can
be defined by extensions, so this is not a complete list.type
- public void setVersion(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 String toString()
toString
in class Object
Object.toString()
public String getManagementKey()
groupId:artifactId:type
public void clearManagementKey()
Copyright © 2001–2021 The Apache Software Foundation. All rights reserved.