Package org.glassfish.spec
Class Artifact
- java.lang.Object
-
- org.glassfish.spec.Artifact
-
public final class Artifact extends java.lang.ObjectRepresent the API JAR file as a Maven artifact.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringartifactIdArtifact artifactId.private java.lang.StringgroupIdArtifact groupId.private static java.lang.StringM_QUALIFIERThe Milestone qualifier.private static java.lang.StringRC_QUALIFIERThe Release Candidate qualifier.private static java.lang.StringSNAPSHOT_QUALIFIERThe Maven SNAPSHOT qualifier.private org.apache.maven.artifact.versioning.ArtifactVersionversionArtifact version.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)static ArtifactfromJar(java.util.jar.JarFile jar)Create anArtifactinstance from a given JAR file.java.lang.StringgetAbsoluteVersion()Get the normalized release version for this artifact.java.lang.StringgetArtifactId()Get the artifactId for this artifact.java.lang.StringgetGroupId()Get the groupId for this artifact.private static java.util.zip.ZipEntrygetPomPropertiesFile(java.util.jar.JarFile jar)Get theZipEntryforpom.propertiesin the given JAR file.org.apache.maven.artifact.versioning.ArtifactVersiongetVersion()Get the version for this artifact.inthashCode()voidsetArtifactId(java.lang.String aId)Set the artifactId of this artifact.voidsetGroupId(java.lang.String gId)Set the groupId of this artifact.voidsetVersion(java.lang.String v)Set the version of this artifact.static java.lang.StringstripApprovedQualifier(java.lang.String version)Strip a small set of approved qualifiers from a given version.java.lang.StringtoString()
-
-
-
Field Detail
-
groupId
private java.lang.String groupId
Artifact groupId.
-
artifactId
private java.lang.String artifactId
Artifact artifactId.
-
version
private org.apache.maven.artifact.versioning.ArtifactVersion version
Artifact version.
-
SNAPSHOT_QUALIFIER
private static final java.lang.String SNAPSHOT_QUALIFIER
The Maven SNAPSHOT qualifier.- See Also:
- Constant Field Values
-
M_QUALIFIER
private static final java.lang.String M_QUALIFIER
The Milestone qualifier.- See Also:
- Constant Field Values
-
RC_QUALIFIER
private static final java.lang.String RC_QUALIFIER
The Release Candidate qualifier.- See Also:
- Constant Field Values
-
-
Method Detail
-
stripApprovedQualifier
public static java.lang.String stripApprovedQualifier(java.lang.String version)
Strip a small set of approved qualifiers from a given version.The Jakarta EE process has defined a few qualifiers that are okay to use in versions. These will be removed from the version as they only serve as an intermediate release placeholder, not something to permanently depend upon.
At the moment these are
-SNAPSHOT,-Mxand-RCx, wherexis typically a number (e.g. -M1, -RC3, etc).- Parameters:
version- the qualifier to process- Returns:
- a version without any of the mentioned qualifiers
-
getArtifactId
public java.lang.String getArtifactId()
Get the artifactId for this artifact.- Returns:
- the artifactId
-
getGroupId
public java.lang.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 java.lang.String getAbsoluteVersion()
Get the normalized release version for this artifact.- Returns:
- the version
-
setArtifactId
public void setArtifactId(java.lang.String aId)
Set the artifactId of this artifact.- Parameters:
aId- the artifactId value to use
-
setGroupId
public void setGroupId(java.lang.String gId)
Set the groupId of this artifact.- Parameters:
gId- the artifactId value to use
-
setVersion
public void setVersion(java.lang.String v)
Set the version of this artifact.- Parameters:
v- the artifactId value to use
-
getPomPropertiesFile
private static java.util.zip.ZipEntry getPomPropertiesFile(java.util.jar.JarFile jar)
Get theZipEntryforpom.propertiesin the given JAR file.- Parameters:
jar- the jar file to process- Returns:
- the
ZipEntryif found,nullotherwise
-
fromJar
public static Artifact fromJar(java.util.jar.JarFile jar) throws java.io.IOException
Create anArtifactinstance from a given JAR file.- Parameters:
jar- the jar file to process- Returns:
- the create
Artifactinstance - Throws:
java.io.IOException- if an error occurs while reading JAR file entries
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-