Class MavenArtifact
java.lang.Object
org.jenkinsci.plugins.pipeline.maven.MavenArtifact
- All Implemented Interfaces:
Serializable,Comparable<MavenArtifact>
- Direct Known Subclasses:
MavenDependency
- Author:
- Cyrille Le Clerc
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleanGets the base version of this artifact, for example "1.0-SNAPSHOT".Gets the classifier of this artifact, for example "sources".Extension of the generated filegetFile()Not persisted in the databasegetId()org.apache.maven.artifact.Artifact#getId()URL of the Maven repository on which the artifact has been deployed ("mvn deploy").Gets a human readable description of this artifactgetType()getUrl()URL of the artifact on the maven repository on which it has been deployed if it has been deployed.Gets the version of this artifact, for example "1.0-20180318.225603-3".inthashCode()booleanArtifact has been deployed to a Maven repository ("mvn deploy")booleanvoidsetArtifactId(String artifactId) voidsetBaseVersion(String baseVersion) voidsetClassifier(String classifier) voidsetExtension(String extension) voidvoidsetGroupId(String groupId) voidsetRepositoryUrl(String repositoryUrl) voidsetSnapshot(boolean snapshot) voidvoidsetVersion(String version) toString()
-
Constructor Details
-
MavenArtifact
public MavenArtifact() -
MavenArtifact
- Parameters:
identifier- Maven$groupId:$artifactId:$version(GAV) or$groupId:$artifactId:$type:$version(GATV)- Throws:
IllegalArgumentException- unsupported identifier
-
-
Method Details
-
getFileName
- See Also:
-
version
-
getFileNameWithBaseVersion
- See Also:
-
baseVersion
-
getFileNameWithVersion
- See Also:
-
baseVersion
-
getId
org.apache.maven.artifact.Artifact#getId() -
getShortDescription
Gets a human readable description of this artifact -
getUrl
URL of the artifact on the maven repository on which it has been deployed if it has been deployed.- Returns:
- URL of the artifact or
nullif the artifact has not been deployed (if "mvn deploy" was not invoked)
-
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<MavenArtifact>
-
isDeployed
public boolean isDeployed()Artifact has been deployed to a Maven repository ("mvn deploy")- See Also:
-
hashCode
public int hashCode() -
equals
-
getBaseVersion
Gets the base version of this artifact, for example "1.0-SNAPSHOT". In contrast to the org.eclipse.aether.artifact.Artifact#getVersion(), the base version will always refer to the unresolved meta version. org.eclipse.aether.artifact.Artifact#getBaseVersion() -
setBaseVersion
-
getVersion
Gets the version of this artifact, for example "1.0-20180318.225603-3". Note that in case of meta versions like "1.0-SNAPSHOT", the artifact's version depends on the state of the artifact. Artifacts that have been resolved or deployed will usually have the meta version expanded. org.eclipse.aether.artifact.Artifact#getVersion() -
setVersion
-
getGroupId
-
setGroupId
-
getArtifactId
-
setArtifactId
-
getType
- Returns:
- The type of this artifact, for example "jar".
-
setType
-
getClassifier
Gets the classifier of this artifact, for example "sources".- Returns:
- The classifier or
nullif none, never empty. org.eclipse.aether.artifact.Artifact#getClassifier()
-
setClassifier
-
getExtension
Extension of the generated file- Returns:
- file extension (e.g. "jar", "war"...) org.eclipse.aether.artifact.Artifact#getExtension()
-
setExtension
-
getFile
Not persisted in the database- Returns:
- absolute path of the generated file in the build agent workspace
-
setFile
-
isSnapshot
public boolean isSnapshot() -
setSnapshot
public void setSnapshot(boolean snapshot) -
getRepositoryUrl
URL of the Maven repository on which the artifact has been deployed ("mvn deploy").
Sample: "https://nexus.my-company.com/content/repositories/snapshots/"
-
setRepositoryUrl
- Parameters:
repositoryUrl- URL of the maven repository the artifact was uploaded to.- See Also:
-