Package org.glassfish.spec
Class Artifact
- java.lang.Object
-
- org.glassfish.spec.Artifact
-
public final class Artifact extends Object
Represent the API JAR file as a Maven artifact.- Author:
- Romain Grecourt
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
static Artifact
fromJar(JarFile jar)
Create anArtifact
instance from a given JAR file.String
getAbsoluteVersion()
Get the normalized release version for this artifact.String
getArtifactId()
Get the artifactId for this artifact.String
getGroupId()
Get the groupId for this artifact.org.apache.maven.artifact.versioning.ArtifactVersion
getVersion()
Get the version for this artifact.int
hashCode()
void
setArtifactId(String aId)
Set the artifactId of this artifact.void
setGroupId(String gId)
Set the groupId of this artifact.void
setVersion(String v)
Set the version of this artifact.static String
stripSnapshotOrRcQualifier(String version)
Strip the SNAPSHOT or RC qualifier from a given version.String
toString()
-
-
-
Method Detail
-
stripSnapshotOrRcQualifier
public static String stripSnapshotOrRcQualifier(String version)
Strip the SNAPSHOT or RC qualifier from a given version.- Parameters:
version
- the qualifier to process- Returns:
- a non SNAPSHOT or RC version
-
getArtifactId
public String getArtifactId()
Get the artifactId for this artifact.- Returns:
- the artifactId
-
getGroupId
public String getGroupId()
Get the groupId for this artifact.- Returns:
- the groupId
-
getVersion
public org.apache.maven.artifact.versioning.ArtifactVersion getVersion()
Get the version for this artifact.- Returns:
- the version
-
getAbsoluteVersion
public String getAbsoluteVersion()
Get the normalized release version for this artifact.- Returns:
- the version
-
setArtifactId
public void setArtifactId(String aId)
Set the artifactId of this artifact.- Parameters:
aId
- the artifactId value to use
-
setGroupId
public void setGroupId(String gId)
Set the groupId of this artifact.- Parameters:
gId
- the artifactId value to use
-
setVersion
public void setVersion(String v)
Set the version of this artifact.- Parameters:
v
- the artifactId value to use
-
fromJar
public static Artifact fromJar(JarFile jar) throws IOException
Create anArtifact
instance from a given JAR file.- Parameters:
jar
- the jar file to process- Returns:
- the create
Artifact
instance - Throws:
IOException
- if an error occurs while reading JAR file entries
-
-