public class Artifact extends Commentable implements Comparable
Constructor and Description |
---|
Artifact(String gId,
String aId,
String version,
String classifier,
String type)
Create a new artifact object
|
Artifact(String gId,
String aId,
String version,
String classifier,
String type,
Map<String,String> metadata)
Create a new artifact object
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Object o) |
boolean |
equals(Object o) |
static Artifact |
fromMvnUrl(String url)
Create a new artifact from a maven url,
'mvn:' [ repository-url '!' ] group-id '/' artifact-id [ '/' [version] [ '/' [type] [ '/' classifier ] ] ] ]
|
String |
getArtifactId()
Return the artifact id.
|
String |
getClassifier()
Return the optional classifier.
|
String |
getGroupId()
Return the group id.
|
Map<String,String> |
getMetadata()
Get the metadata of the artifact.
|
String |
getRepositoryPath()
Create a Maven like relative repository path.
|
String |
getType()
Return the type.
|
String |
getVersion()
Return the version.
|
int |
hashCode() |
String |
toMvnUrl()
Return a mvn url
|
String |
toString() |
getComment, setComment
getLocation, setLocation
public Artifact(String gId, String aId, String version, String classifier, String type)
gId
- The group id (required)aId
- The artifact id (required)version
- The version (required)classifier
- The classifier (optional)type
- The type/extension (optional, defaults to jar)public Artifact(String gId, String aId, String version, String classifier, String type, Map<String,String> metadata)
gId
- The group id (required)aId
- The artifact id (required)version
- The version (required)classifier
- The classifier (optional)type
- The type/extension (optional, defaults to jar)metadata
- The metadata associated with the Artifactpublic static Artifact fromMvnUrl(String url)
url
- The urlIllegalArgumentException
- If the url is not validpublic int compareTo(Object o)
compareTo
in interface Comparable
public String toMvnUrl()
fromMvnUrl(String)
public String getGroupId()
public String getArtifactId()
public String getVersion()
public String getClassifier()
public String getType()
public Map<String,String> getMetadata()
public String getRepositoryPath()
public String toString()
toString
in class Commentable
Copyright © 2017 The Apache Software Foundation. All rights reserved.