org.apache.maven.project
Class Dependency

java.lang.Object
  extended byorg.apache.maven.project.BaseObject
      extended byorg.apache.maven.project.Dependency

public class Dependency
extends BaseObject

Version:
$Id: Dependency.java 122095 2004-03-01 22:36:39Z evenisse $
Author:
Jason van Zyl, Vincent Massol

Field Summary
 
Fields inherited from class org.apache.maven.project.BaseObject
id
 
Constructor Summary
Dependency()
          Default constructor
 
Method Summary
 java.lang.String getArtifact()
          Gets the artifact name of the dependency.
 java.lang.String getArtifactDirectory()
          Get the directory to place the artifact in.
 java.lang.String getArtifactId()
          Get the artifact id.
 java.lang.String getExtension()
           
 java.lang.String getGroupId()
          Get the group id.
 java.lang.String getId()
          Gets the id attribute
 java.lang.String getJar()
          Get the name of the JAR.
 java.lang.String getType()
           
 java.lang.String getUrl()
          Get the name of the url for the dependency.
 java.lang.String getVersion()
          Get the version of this dependency.
 boolean isAddedToClasspath()
          Usually only jars and ejbs are added to the classpath
 boolean isPlugin()
           
 void setArtifactId(java.lang.String artifactId)
          Set the artifact name.
 void setGroupId(java.lang.String groupId)
          Set the group id.
 void setId(java.lang.String id)
          Set the id for this dependency.
 void setJar(java.lang.String jar)
          Set the name of the JAR if it cannot be synthesized from the id and version.
 void setType(java.lang.String type)
          Sets the dependency type such as "jar" or "war"
 void setUrl(java.lang.String url)
          Set the name of url for the dependency.
 void setVersion(java.lang.String version)
          Set the version for this dependency.
 java.lang.String toString()
          Debug string.
 
Methods inherited from class org.apache.maven.project.BaseObject
addProperty, equals, getName, getProperties, getProperty, hashCode, isValid, resolvedProperties, setName, setProperties
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Dependency

public Dependency()
Default constructor

Method Detail

setId

public void setId(java.lang.String id)
Set the id for this dependency.

Overrides:
setId in class BaseObject
Parameters:
id - for this dependency

getId

public java.lang.String getId()
                       throws java.lang.IllegalStateException
Description copied from class: BaseObject
Gets the id attribute

Overrides:
getId in class BaseObject
Returns:
groupId:artifactId if both are valid, or the id.
Throws:
java.lang.IllegalStateException - if groupId, artifactId and id are all invalid

setGroupId

public void setGroupId(java.lang.String groupId)
Set the group id.

Parameters:
groupId - Group id for the dependency.

getGroupId

public java.lang.String getGroupId()
Get the group id.

Returns:
The group id for the dependency.

getArtifactDirectory

public java.lang.String getArtifactDirectory()
Get the directory to place the artifact in. If the groupId has been set then use that, otherwise use the id.

Returns:
The artifact directory.

getArtifactId

public java.lang.String getArtifactId()
Get the artifact id.

Returns:
The artifact id.

setArtifactId

public void setArtifactId(java.lang.String artifactId)
Set the artifact name.

Parameters:
artifactId - The artifact name of the dependency.

getArtifact

public java.lang.String getArtifact()
Gets the artifact name of the dependency. This is always calculated so that the version can be changed dynamically using the maven override facility.

Returns:
The artifact name.

setVersion

public void setVersion(java.lang.String version)
Set the version for this dependency.

Parameters:
version - Version for this dependency

getVersion

public java.lang.String getVersion()
Get the version of this dependency.

Returns:
Version of this dependency

setJar

public void setJar(java.lang.String jar)
Set the name of the JAR if it cannot be synthesized from the id and version.

Parameters:
jar - Name of the jar

getJar

public java.lang.String getJar()
Get the name of the JAR. We will attempt to synthesize the name of the JAR from the id and version.

Returns:
Name of the jar

setUrl

public void setUrl(java.lang.String url)
Set the name of url for the dependency.

Parameters:
url - the dependency's home page

getUrl

public java.lang.String getUrl()
Get the name of the url for the dependency.

Returns:
Name of the url for the dependency

getType

public java.lang.String getType()
Returns:
dependency type such as "jar", "war", etc.

getExtension

public java.lang.String getExtension()
Returns:
dependency extension such as "jar", "war", etc.

setType

public void setType(java.lang.String type)
Sets the dependency type such as "jar" or "war"

Parameters:
type - The type of dependency.

toString

public java.lang.String toString()
Debug string.

Overrides:
toString in class BaseObject
Returns:
Debugging string.

isAddedToClasspath

public boolean isAddedToClasspath()
Usually only jars and ejbs are added to the classpath

Returns:
true if the given dependency belongs on the classpath

isPlugin

public boolean isPlugin()
Returns:
true if the dependency is a maven plugin


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