Package org.glassfish.spec
Class Artifact
java.lang.Object
org.glassfish.spec.Artifact
Represent the API JAR file as a Maven artifact.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
Artifact artifactId.private static final String[]
Characters used to separate the build number within the version.private String
Artifact build number.private String
Artifact groupId.static final String
The Maven SNAPSHOT qualifier.private org.apache.maven.artifact.versioning.ArtifactVersion
Artifact version. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
static Artifact
Create anArtifact
instance from a given JAR file.Get the normalized release version for this artifact.Get the artifactId for this artifact.Get the build number of this artifact.private static String
getBuildNumber
(String qualifier) Parse a version qualifier and extract the build number.Get the groupId for this artifact.private static ZipEntry
Get theZipEntry
forpom.properties
in the given JAR file.org.apache.maven.artifact.versioning.ArtifactVersion
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
stripSnapshotQualifier
(String qualifier) Strip the SNAPSHOT qualifier from a given qualifier.toString()
-
Field Details
-
groupId
Artifact groupId. -
artifactId
Artifact artifactId. -
version
private org.apache.maven.artifact.versioning.ArtifactVersion versionArtifact version. -
buildNumber
Artifact build number. -
BUILD_NUMBER_SEPARATORS
Characters used to separate the build number within the version. -
SNAPSHOT_QUALIFIER
The Maven SNAPSHOT qualifier.- See Also:
-
-
Constructor Details
-
Method Details
-
stripSnapshotQualifier
Strip the SNAPSHOT qualifier from a given qualifier.- Parameters:
qualifier
- the qualifier to process- Returns:
- a non SNAPSHOT qualifier
-
getBuildNumber
Parse a version qualifier and extract the build number.- Parameters:
qualifier
- the qualifier to process- Returns:
- the build number, or
null
if none found
-
getArtifactId
Get the artifactId for this artifact.- Returns:
- the artifactId
-
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
Get the normalized release version for this artifact.- Returns:
- the version
-
setArtifactId
Set the artifactId of this artifact.- Parameters:
aId
- the artifactId value to use
-
setGroupId
Set the groupId of this artifact.- Parameters:
gId
- the artifactId value to use
-
setVersion
Set the version of this artifact.- Parameters:
v
- the artifactId value to use
-
getBuildNumber
Get the build number of this artifact.- Returns:
- the build number
-
getPomPropertiesFile
Get theZipEntry
forpom.properties
in the given JAR file.- Parameters:
jar
- the jar file to process- Returns:
- the
ZipEntry
if found,null
otherwise
-
fromJar
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
-
toString
-
equals
-
hashCode
public int hashCode()
-