Package org.apache.maven.model.v3_0_0
Class Dependency
- java.lang.Object
-
- org.apache.maven.model.v3_0_0.Dependency
-
- All Implemented Interfaces:
java.io.Serializable
public class Dependency extends java.lang.Object implements java.io.Serializable
The<dependency>
element contains information about a dependency of the project.- Version:
- $Revision$ $Date$
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
artifactId
The unique id for an artifact produced by the project group, e.g.private java.lang.String
groupId
The project group that produced the dependency, e.g.private java.lang.String
id
Deprecated.private java.lang.String
jar
Literal name of the artifact in the repository.private java.util.Properties
properties
Field properties.private java.lang.String
type
The type of dependency.private java.lang.String
url
This url will be provided to the user if the jar file cannot be downloaded from the central repository.private java.lang.String
version
The version of the dependency, e.g.
-
Constructor Summary
Constructors Constructor Description Dependency()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addProperty(java.lang.String key, java.lang.String value)
Method addProperty.boolean
equals(java.lang.Object o)
java.lang.String
getArtifact()
java.lang.String
getArtifactDirectory()
java.lang.String
getArtifactId()
Get the unique id for an artifact produced by the project group, e.g.java.lang.String
getExtension()
java.lang.String
getGroupId()
Get the project group that produced the dependency, e.g.java.lang.String
getId()
Get Deprecated.java.lang.String
getJar()
Get literal name of the artifact in the repository.java.lang.String
getKey()
java.util.Properties
getProperties()
Method getProperties.java.lang.String
getProperty(java.lang.String property)
java.lang.String
getType()
Get the type of dependency.java.lang.String
getTypeDirectory()
java.lang.String
getUrl()
Get this url will be provided to the user if the jar file cannot be downloaded from the central repository.java.lang.String
getVersion()
Get the version of the dependency, e.g.int
hashCode()
boolean
isAddedToClasspath()
boolean
isPlugin()
void
setArtifactId(java.lang.String artifactId)
Set the unique id for an artifact produced by the project group, e.g.void
setGroupId(java.lang.String groupId)
Set the project group that produced the dependency, e.g.void
setId(java.lang.String id)
Set Deprecated.void
setJar(java.lang.String jar)
Set literal name of the artifact in the repository.void
setProperties(java.util.Properties properties)
Set properties about the dependency.void
setType(java.lang.String type)
Set the type of dependency.void
setUrl(java.lang.String url)
Set this url will be provided to the user if the jar file cannot be downloaded from the central repository.void
setVersion(java.lang.String version)
Set the version of the dependency, e.g.java.lang.String
toString()
-
-
-
Field Detail
-
id
private java.lang.String id
Deprecated. Please usegroupId
andartifactId
together instead.
-
groupId
private java.lang.String groupId
The project group that produced the dependency, e.g.org.apache.maven
.
-
artifactId
private java.lang.String artifactId
The unique id for an artifact produced by the project group, e.g.maven-artifact
.
-
version
private java.lang.String version
The version of the dependency, e.g.3.2.1
. In Maven 2, this can also be specified as a range of versions.
-
url
private java.lang.String url
This url will be provided to the user if the jar file cannot be downloaded from the central repository.
-
jar
private java.lang.String jar
Literal name of the artifact in the repository. Used to override the calculated artifact name.
-
type
private java.lang.String type
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.
-
properties
private java.util.Properties properties
Field properties.
-
-
Method Detail
-
addProperty
public void addProperty(java.lang.String key, java.lang.String value)
Method addProperty.- Parameters:
key
-value
-
-
getArtifactId
public java.lang.String getArtifactId()
Get the unique id for an artifact produced by the project group, e.g.maven-artifact
.- Returns:
- String
-
getGroupId
public java.lang.String getGroupId()
Get the project group that produced the dependency, e.g.org.apache.maven
.- Returns:
- String
-
getId
public java.lang.String getId()
Get Deprecated. Please usegroupId
andartifactId
together instead.- Returns:
- String
-
getJar
public java.lang.String getJar()
Get literal name of the artifact in the repository. Used to override the calculated artifact name.- Returns:
- String
-
getProperties
public java.util.Properties getProperties()
Method getProperties.- Returns:
- Properties
-
getType
public java.lang.String 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
public java.lang.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
public java.lang.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
public void setArtifactId(java.lang.String artifactId)
Set the unique id for an artifact produced by the project group, e.g.maven-artifact
.- Parameters:
artifactId
-
-
setGroupId
public void setGroupId(java.lang.String groupId)
Set the project group that produced the dependency, e.g.org.apache.maven
.- Parameters:
groupId
-
-
setId
public void setId(java.lang.String id)
Set Deprecated. Please usegroupId
andartifactId
together instead.- Parameters:
id
-
-
setJar
public void setJar(java.lang.String jar)
Set literal name of the artifact in the repository. Used to override the calculated artifact name.- Parameters:
jar
-
-
setProperties
public void setProperties(java.util.Properties properties)
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
-
-
setType
public void setType(java.lang.String type)
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
-
-
setUrl
public void setUrl(java.lang.String url)
Set this url will be provided to the user if the jar file cannot be downloaded from the central repository.- Parameters:
url
-
-
setVersion
public void setVersion(java.lang.String version)
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
-
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- See Also:
Object.toString()
-
getKey
public java.lang.String getKey()
- Returns:
- the key as
id:type
-
getArtifactDirectory
public java.lang.String getArtifactDirectory()
- Returns:
- the groupId as artifact directory
-
getArtifact
public java.lang.String getArtifact()
- Returns:
- the artifact name as
artifactId-version.extension
if <jar/> not set
-
getTypeDirectory
public java.lang.String getTypeDirectory()
-
getExtension
public java.lang.String getExtension()
-
isAddedToClasspath
public boolean isAddedToClasspath()
-
isPlugin
public boolean isPlugin()
-
getProperty
public java.lang.String getProperty(java.lang.String property)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
- See Also:
Object.hashCode()
-
-