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 TypeMethodDescriptionvoidaddProperty(String key, String value) Method addProperty.booleanGet 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.inthashCode()booleanbooleanisPlugin()voidsetArtifactId(String artifactId) Set the unique id for an artifact produced by the project group, e.g.voidsetGroupId(String groupId) Set the project group that produced the dependency, e.g.voidSet Deprecated.voidSet literal name of the artifact in the repository.voidsetProperties(Properties properties) Set properties about the dependency.voidSet the type of dependency.voidSet this url will be provided to the user if the jar file cannot be downloaded from the central repository.voidsetVersion(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 usegroupIdandartifactIdtogether 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 typepluginis 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 usegroupIdandartifactIdtogether 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.bundleproperty, 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 typepluginis 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.extensionif <jar/> not set
-
getTypeDirectory
-
getExtension
-
isAddedToClasspath
public boolean isAddedToClasspath() -
isPlugin
public boolean isPlugin() -
getProperty
-
equals
-
hashCode
public int hashCode()
-