Class Artifact
java.lang.Object
org.apache.sling.provisioning.model.Traceable
org.apache.sling.provisioning.model.Commentable
org.apache.sling.provisioning.model.Artifact
- All Implemented Interfaces:
Comparable
Description of an artifact.
An artifact is described by it's Apache Maven coordinates consisting of group id, artifact id, and version.
In addition, the classifier and type can be specified as well. If no type is specified, "jar" is assumed.
An artifact can have any metadata.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
static Artifact
fromMvnUrl
(String url) Create a new artifact from a maven url, 'mvn:' [ repository-url '!'Return the artifact id.Return the optional classifier.Return the group id.Get the metadata of the artifact.Create a Maven like relative repository path.getType()
Return the type.Return the version.int
hashCode()
toMvnUrl()
Return a mvn urltoString()
Methods inherited from class org.apache.sling.provisioning.model.Commentable
getComment, setComment
Methods inherited from class org.apache.sling.provisioning.model.Traceable
getLocation, setLocation
-
Constructor Details
-
Artifact
Create a new artifact object- Parameters:
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)
-
Artifact
public Artifact(String gId, String aId, String version, String classifier, String type, Map<String, String> metadata) Create a new artifact object- Parameters:
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 Artifact
-
-
Method Details
-
fromMvnUrl
Create a new artifact from a maven url, 'mvn:' [ repository-url '!' ] group-id '/' artifact-id [ '/' [version] [ '/' [type] [ '/' classifier ] ] ] ]- Parameters:
url
- The url- Returns:
- A new artifact
- Throws:
IllegalArgumentException
- If the url is not valid
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareTo
in interfaceComparable
-
toMvnUrl
Return a mvn url- Returns:
- A mvn url
- See Also:
-
getGroupId
Return the group id.- Returns:
- The group id.
-
getArtifactId
Return the artifact id.- Returns:
- The artifact id.
-
getVersion
Return the version.- Returns:
- The version.
-
getClassifier
Return the optional classifier.- Returns:
- The classifier or null.
-
getType
Return the type.- Returns:
- The type.
-
getMetadata
Get the metadata of the artifact.- Returns:
- The metadata.
-
getRepositoryPath
Create a Maven like relative repository path.- Returns:
- A relative repository path.
-
toString
- Overrides:
toString
in classCommentable
-