org.apache.maven.artifact
Interface Artifact

All Superinterfaces:
Comparable
All Known Implementing Classes:
ActiveProjectArtifact, DefaultArtifact

public interface Artifact
extends Comparable

Description of an artifact.


Field Summary
static String LATEST_VERSION
           
static String RELEASE_VERSION
           
static String SCOPE_COMPILE
           
static String SCOPE_IMPORT
           
static String SCOPE_PROVIDED
           
static String SCOPE_RUNTIME
           
static String SCOPE_SYSTEM
           
static String SCOPE_TEST
           
static String SNAPSHOT_VERSION
           
static Pattern VERSION_FILE_PATTERN
           
 
Method Summary
 void addMetadata(ArtifactMetadata metadata)
           
 ArtifactHandler getArtifactHandler()
           
 String getArtifactId()
           
 List getAvailableVersions()
           
 String getBaseVersion()
           
 String getClassifier()
           
 String getDependencyConflictId()
           
 ArtifactFilter getDependencyFilter()
           
 List getDependencyTrail()
           
 String getDownloadUrl()
           
 File getFile()
           
 String getGroupId()
           
 String getId()
           
 ArtifactMetadata getMetadata(Class metadataClass)
           
 Collection getMetadataList()
           
 ArtifactRepository getRepository()
           
 String getScope()
          Get the scope of the artifact.
 ArtifactVersion getSelectedVersion()
           
 String getType()
           
 String getVersion()
           
 VersionRange getVersionRange()
           
 boolean hasClassifier()
           
 boolean isOptional()
           
 boolean isRelease()
           
 boolean isResolved()
           
 boolean isSelectedVersionKnown()
           
 boolean isSnapshot()
           
 void selectVersion(String version)
           
 void setArtifactHandler(ArtifactHandler handler)
           
 void setArtifactId(String artifactId)
           
 void setAvailableVersions(List versions)
           
 void setBaseVersion(String baseVersion)
           
 void setDependencyFilter(ArtifactFilter artifactFilter)
           
 void setDependencyTrail(List dependencyTrail)
           
 void setDownloadUrl(String downloadUrl)
           
 void setFile(File destination)
           
 void setGroupId(String groupId)
           
 void setOptional(boolean optional)
           
 void setRelease(boolean release)
           
 void setRepository(ArtifactRepository remoteRepository)
           
 void setResolved(boolean resolved)
           
 void setResolvedVersion(String version)
           
 void setScope(String scope)
           
 void setVersion(String version)
           
 void setVersionRange(VersionRange newRange)
           
 void updateVersion(String version, ArtifactRepository localRepository)
           
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

LATEST_VERSION

public static final String LATEST_VERSION
See Also:
Constant Field Values

SNAPSHOT_VERSION

public static final String SNAPSHOT_VERSION
See Also:
Constant Field Values

VERSION_FILE_PATTERN

public static final Pattern VERSION_FILE_PATTERN

SCOPE_COMPILE

public static final String SCOPE_COMPILE
See Also:
Constant Field Values

SCOPE_TEST

public static final String SCOPE_TEST
See Also:
Constant Field Values

SCOPE_RUNTIME

public static final String SCOPE_RUNTIME
See Also:
Constant Field Values

SCOPE_PROVIDED

public static final String SCOPE_PROVIDED
See Also:
Constant Field Values

SCOPE_SYSTEM

public static final String SCOPE_SYSTEM
See Also:
Constant Field Values

SCOPE_IMPORT

public static final String SCOPE_IMPORT
See Also:
Constant Field Values

RELEASE_VERSION

public static final String RELEASE_VERSION
See Also:
Constant Field Values
Method Detail

getGroupId

public String getGroupId()

getArtifactId

public String getArtifactId()

getVersion

public String getVersion()

setVersion

public void setVersion(String version)

getScope

public String getScope()
Get the scope of the artifact. If the artifact is a standalone rather than a dependency, it's scope will be null. The scope may not be the same as it was declared on the original dependency, as this is the result of combining it with the main project scope.

Returns:
the scope

getType

public String getType()

getClassifier

public String getClassifier()

hasClassifier

public boolean hasClassifier()

getFile

public File getFile()

setFile

public void setFile(File destination)

getBaseVersion

public String getBaseVersion()

setBaseVersion

public void setBaseVersion(String baseVersion)

getId

public String getId()

getDependencyConflictId

public String getDependencyConflictId()

addMetadata

public void addMetadata(ArtifactMetadata metadata)

getMetadata

public ArtifactMetadata getMetadata(Class metadataClass)

getMetadataList

public Collection getMetadataList()

setRepository

public void setRepository(ArtifactRepository remoteRepository)

getRepository

public ArtifactRepository getRepository()

updateVersion

public void updateVersion(String version,
                          ArtifactRepository localRepository)

getDownloadUrl

public String getDownloadUrl()

setDownloadUrl

public void setDownloadUrl(String downloadUrl)

getDependencyFilter

public ArtifactFilter getDependencyFilter()

setDependencyFilter

public void setDependencyFilter(ArtifactFilter artifactFilter)

getArtifactHandler

public ArtifactHandler getArtifactHandler()

getDependencyTrail

public List getDependencyTrail()
Returns:
List < String > with artifact ids

setDependencyTrail

public void setDependencyTrail(List dependencyTrail)
Parameters:
dependencyTrail - List < String > with artifact ids

setScope

public void setScope(String scope)

getVersionRange

public VersionRange getVersionRange()

setVersionRange

public void setVersionRange(VersionRange newRange)

selectVersion

public void selectVersion(String version)

setGroupId

public void setGroupId(String groupId)

setArtifactId

public void setArtifactId(String artifactId)

isSnapshot

public boolean isSnapshot()

setResolved

public void setResolved(boolean resolved)

isResolved

public boolean isResolved()

setResolvedVersion

public void setResolvedVersion(String version)

setArtifactHandler

public void setArtifactHandler(ArtifactHandler handler)

isRelease

public boolean isRelease()

setRelease

public void setRelease(boolean release)

getAvailableVersions

public List getAvailableVersions()

setAvailableVersions

public void setAvailableVersions(List versions)

isOptional

public boolean isOptional()

setOptional

public void setOptional(boolean optional)

getSelectedVersion

public ArtifactVersion getSelectedVersion()
                                   throws OverConstrainedVersionException
Throws:
OverConstrainedVersionException

isSelectedVersionKnown

public boolean isSelectedVersionKnown()
                               throws OverConstrainedVersionException
Throws:
OverConstrainedVersionException


Copyright © 2001-2009 The Apache Software Foundation. All Rights Reserved.