Package org.apache.maven.model.v3_0_0
Class Dependency
java.lang.Object
org.apache.maven.model.v3_0_0.Dependency
- All Implemented Interfaces:
Serializable
The
<dependency>
element contains
information about a dependency
of the project.- Version:
- $Revision$ $Date$
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addProperty
(String key, String value) Method addProperty.boolean
Get the unique id for an artifact produced by the project group, e.g.Get the project group that produced the dependency, e.g.getId()
Get Deprecated.getJar()
Get literal name of the artifact in the repository.getKey()
Method getProperties.getProperty
(String property) getType()
Get the type of dependency.getUrl()
Get this url will be provided to the user if the jar file cannot be downloaded from the central repository.Get the version of the dependency, e.g.int
hashCode()
boolean
boolean
isPlugin()
void
setArtifactId
(String artifactId) Set the unique id for an artifact produced by the project group, e.g.void
setGroupId
(String groupId) Set the project group that produced the dependency, e.g.void
Set Deprecated.void
Set literal name of the artifact in the repository.void
setProperties
(Properties properties) Set properties about the dependency.void
Set the type of dependency.void
Set this url will be provided to the user if the jar file cannot be downloaded from the central repository.void
setVersion
(String version) Set the version of the dependency, e.g.toString()
-
Constructor Details
-
Dependency
public Dependency()
-
-
Method Details
-
addProperty
Method addProperty.- Parameters:
key
- a key object.value
- a value object.
-
getArtifactId
Get the unique id for an artifact produced by the project group, e.g.maven-artifact
.- Returns:
- String
-
getGroupId
Get the project group that produced the dependency, e.g.org.apache.maven
.- Returns:
- String
-
getId
Get Deprecated. Please usegroupId
andartifactId
together instead.- Returns:
- String
-
getJar
Get literal name of the artifact in the repository. Used to override the calculated artifact name.- Returns:
- String
-
getProperties
Method getProperties.- Returns:
- Properties
-
getType
Get the type of dependency. This defaults tojar
. While it usually represents the extension on the filename of the dependency, that is not always the case. Some examples arejar
,war
, andplugin
. A dependency of typeplugin
is loaded as a Maven plugin and not added to the project build classpath.- Returns:
- String
-
getUrl
Get this url will be provided to the user if the jar file cannot be downloaded from the central repository.- Returns:
- String
-
getVersion
Get the version of the dependency, e.g.3.2.1
. In Maven 2, this can also be specified as a range of versions.- Returns:
- String
-
setArtifactId
Set the unique id for an artifact produced by the project group, e.g.maven-artifact
.- Parameters:
artifactId
- a artifactId object.
-
setGroupId
Set the project group that produced the dependency, e.g.org.apache.maven
.- Parameters:
groupId
- a groupId object.
-
setId
Set Deprecated. Please usegroupId
andartifactId
together instead.- Parameters:
id
- a id object.
-
setJar
Set literal name of the artifact in the repository. Used to override the calculated artifact name.- Parameters:
jar
- a jar object.
-
setProperties
Set properties about the dependency. Various plugins allow you to mark dependencies with properties. For example the war plugin looks for awar.bundle
property, and if found will include the dependency inWEB-INF/lib
.- Parameters:
properties
- a properties object.
-
setType
Set the type of dependency. This defaults tojar
. While it usually represents the extension on the filename of the dependency, that is not always the case. Some examples arejar
,war
, andplugin
. A dependency of typeplugin
is loaded as a Maven plugin and not added to the project build classpath.- Parameters:
type
- a type object.
-
setUrl
Set this url will be provided to the user if the jar file cannot be downloaded from the central repository.- Parameters:
url
- a url object.
-
setVersion
Set the version of the dependency, e.g.3.2.1
. In Maven 2, this can also be specified as a range of versions.- Parameters:
version
- a version object.
-
toString
-
getKey
- Returns:
- the key as
id:type
-
getArtifactDirectory
- Returns:
- the groupId as artifact directory
-
getArtifact
- Returns:
- the artifact name as
artifactId-version.extension
if <jar/> not set
-
getTypeDirectory
-
getExtension
-
isAddedToClasspath
public boolean isAddedToClasspath() -
isPlugin
public boolean isPlugin() -
getProperty
-
equals
-
hashCode
public int hashCode()
-