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
-
-
Field Summary
Fields Modifier and Type Field Description static StringSNAPSHOT_QUALIFIERThe Maven SNAPSHOT qualifier.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)static ArtifactfromJar(JarFile jar)Create anArtifactinstance from a given JAR file.StringgetAbsoluteVersion()Get the normalized release version for this artifact.StringgetArtifactId()Get the artifactId for this artifact.StringgetBuildNumber()Get the build number of this artifact.StringgetGroupId()Get the groupId for this artifact.org.apache.maven.artifact.versioning.ArtifactVersiongetVersion()Get the version for this artifact.inthashCode()voidsetArtifactId(String aId)Set the artifactId of this artifact.voidsetGroupId(String gId)Set the groupId of this artifact.voidsetVersion(String v)Set the version of this artifact.static StringstripSnapshotQualifier(String qualifier)Strip the SNAPSHOT qualifier from a given qualifier.StringtoString()
-
-
-
Field Detail
-
SNAPSHOT_QUALIFIER
public static final String SNAPSHOT_QUALIFIER
The Maven SNAPSHOT qualifier.- See Also:
- Constant Field Values
-
-
Method Detail
-
stripSnapshotQualifier
public static String stripSnapshotQualifier(String qualifier)
Strip the SNAPSHOT qualifier from a given qualifier.- Parameters:
qualifier- the qualifier to process- Returns:
- a non SNAPSHOT qualifier
-
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
-
getBuildNumber
public String getBuildNumber()
Get the build number of this artifact.- Returns:
- the build number
-
fromJar
public static Artifact fromJar(JarFile jar) throws IOException
Create anArtifactinstance from a given JAR file.- Parameters:
jar- the jar file to process- Returns:
- the create
Artifactinstance - Throws:
IOException- if an error occurs while reading JAR file entries
-
-