org.apache.maven.model.v3_0_0
Class Dependency

java.lang.Object
  extended by org.apache.maven.model.v3_0_0.Dependency
All Implemented Interfaces:
Serializable

public class Dependency
extends Object
implements Serializable

Class Dependency.

Version:
$Revision$ $Date$
See Also:
Serialized Form

Constructor Summary
Dependency()
           
 
Method Summary
 void addProperty(String key, String value)
          Method addProperty.
 boolean equals(Object o)
           
 String getArtifact()
           
 String getArtifactDirectory()
           
 String getArtifactId()
          Get the unique id for an artifact produced by the project group, e.g.
 String getExtension()
           
 String getGroupId()
          Get the project group that produced the dependency, e.g.
 String getId()
          Get Deprecated.
 String getJar()
          Get literal name of the artifact in the repository.
 String getKey()
           
 Properties getProperties()
          Method getProperties.
 String getProperty(String property)
           
 String getType()
          Get the type of dependency.
 String getTypeDirectory()
           
 String getUrl()
          Get this url will be provided to the user if the jar file cannot be downloaded from the central repository.
 String getVersion()
          Get the version of the dependency, e.g.
 int hashCode()
           
 boolean isAddedToClasspath()
           
 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 setId(String id)
          Set Deprecated.
 void setJar(String jar)
          Set literal name of the artifact in the repository.
 void setProperties(Properties properties)
          Set properties about the dependency.
 void setType(String type)
          Set the type of dependency.
 void setUrl(String url)
          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.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Dependency

public Dependency()
Method Detail

addProperty

public void addProperty(String key,
                        String value)
Method addProperty.

Parameters:
key -
value -

getArtifactId

public String getArtifactId()
Get the unique id for an artifact produced by the project group, e.g. maven-artifact.

Returns:
String

getGroupId

public String getGroupId()
Get the project group that produced the dependency, e.g. org.apache.maven.

Returns:
String

getId

public String getId()
Get Deprecated. Please use groupId and artifactId together instead.

Returns:
String

getJar

public String getJar()
Get literal name of the artifact in the repository. Used to override the calculated artifact name.

Returns:
String

getProperties

public Properties getProperties()
Method getProperties.

Returns:
Properties

getType

public String getType()
Get the type of dependency. This defaults to jar. While it usually represents the extension on the filename of the dependency, that is not always the case. Some examples are jar, war, and plugin. A dependency of type plugin is loaded as a Maven plugin and not added to the project build classpath.

Returns:
String

getUrl

public 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 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(String artifactId)
Set the unique id for an artifact produced by the project group, e.g. maven-artifact.

Parameters:
artifactId -

setGroupId

public void setGroupId(String groupId)
Set the project group that produced the dependency, e.g. org.apache.maven.

Parameters:
groupId -

setId

public void setId(String id)
Set Deprecated. Please use groupId and artifactId together instead.

Parameters:
id -

setJar

public void setJar(String jar)
Set literal name of the artifact in the repository. Used to override the calculated artifact name.

Parameters:
jar -

setProperties

public void setProperties(Properties properties)
Set properties about the dependency. Various plugins allow you to mark dependencies with properties. For example the war plugin looks for a war.bundle property, and if found will include the dependency in WEB-INF/lib.

Parameters:
properties -

setType

public void setType(String type)
Set the type of dependency. This defaults to jar. While it usually represents the extension on the filename of the dependency, that is not always the case. Some examples are jar, war, and plugin. A dependency of type plugin is loaded as a Maven plugin and not added to the project build classpath.

Parameters:
type -

setUrl

public void setUrl(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(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 String toString()
Overrides:
toString in class Object

getKey

public String getKey()

getArtifactDirectory

public String getArtifactDirectory()

getArtifact

public String getArtifact()

getTypeDirectory

public String getTypeDirectory()

getExtension

public String getExtension()

isAddedToClasspath

public boolean isAddedToClasspath()

isPlugin

public boolean isPlugin()

getProperty

public String getProperty(String property)

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2001-2011 Apache Software Foundation. All Rights Reserved.