@ExportedBean public final class MavenArtifact extends Object implements Serializable
This object is created within the Maven process and sent back to the master, so it shouldn't contain anything non-serializable as fields.
Once it's constructed, the object should be considered final and immutable.
| Modifier and Type | Class and Description |
|---|---|
static class |
MavenArtifact.CloseableArtifact
Artifact holder that can be released in a finally-block. |
class |
MavenArtifact.TemporaryFile
Representation of an archived artifact that might be accessed in various ways.
|
| Modifier and Type | Field and Description |
|---|---|
String |
artifactId
Basic parameters of a Maven artifact.
|
String |
canonicalName
The canonical artifact file name, used by Maven in the repository.
|
String |
classifier
Basic parameters of a Maven artifact.
|
String |
fileName
File name (without directory portion) of this artifact in the Hudson archive.
|
String |
groupId
Basic parameters of a Maven artifact.
|
String |
md5sum
The md5sum for this artifact.
|
String |
type
Basic parameters of a Maven artifact.
|
String |
version
Basic parameters of a Maven artifact.
|
| Constructor and Description |
|---|
MavenArtifact(org.apache.maven.artifact.Artifact a) |
MavenArtifact(String groupId,
String artifactId,
String version,
String classifier,
String type,
String fileName,
String md5sum) |
| Modifier and Type | Method and Description |
|---|---|
void |
archive(MavenBuildProxy build,
File file,
hudson.model.BuildListener listener)
Called from within Maven to archive an artifact in Hudson.
|
static MavenArtifact |
create(org.apache.maven.artifact.Artifact a)
Convenience method to check if the given
Artifact object contains
enough information suitable for recording, and if so, create MavenArtifact. |
org.kohsuke.stapler.HttpResponse |
doFile(MavenArtifactRecord parent)
Serve the file.
|
hudson.model.Api |
getApi() |
File |
getFile(MavenBuild build)
Deprecated.
only works with
StandardArtifactManager and subclasses; use getTemporaryFile(hudson.maven.MavenBuild) instead |
MavenArtifact.TemporaryFile |
getTemporaryFile(MavenBuild build)
Gets an archived artifact.
|
boolean |
isPOM() |
org.apache.maven.artifact.Artifact |
toArtifact(org.apache.maven.artifact.handler.manager.ArtifactHandlerManager handlerManager,
org.apache.maven.artifact.factory.ArtifactFactory factory,
MavenBuild build)
Deprecated.
only works with
StandardArtifactManager and subclasses; use toCloseableArtifact(org.apache.maven.artifact.handler.manager.ArtifactHandlerManager, org.apache.maven.artifact.factory.ArtifactFactory, hudson.maven.MavenBuild) instead |
MavenArtifact.CloseableArtifact |
toCloseableArtifact(org.apache.maven.artifact.handler.manager.ArtifactHandlerManager handlerManager,
org.apache.maven.artifact.factory.ArtifactFactory factory,
MavenBuild build)
Creates a Maven
Artifact back from the persisted data. |
@Exported public final String groupId
@Exported public final String artifactId
@Exported public final String version
@Exported public final String classifier
@Exported public final String type
@Exported public final String fileName
<finalName> setting in POM.
This name is taken directly from the name of the file as used during the build
(thus POM would be most likely just pom.xml and artifacts would
use their finalName if one is configured.) This is often
different from canonicalName.
@Exported public final String canonicalName
The reason we persist this is that the extension is only available
through ArtifactHandler.
@Exported public final String md5sum
public MavenArtifact(org.apache.maven.artifact.Artifact a)
throws IOException
IOExceptionpublic static MavenArtifact create(org.apache.maven.artifact.Artifact a) throws IOException
Artifact object contains
enough information suitable for recording, and if so, create MavenArtifact.IOExceptionpublic boolean isPOM()
@Deprecated public org.apache.maven.artifact.Artifact toArtifact(org.apache.maven.artifact.handler.manager.ArtifactHandlerManager handlerManager, org.apache.maven.artifact.factory.ArtifactFactory factory, MavenBuild build) throws IOException
StandardArtifactManager and subclasses; use toCloseableArtifact(org.apache.maven.artifact.handler.manager.ArtifactHandlerManager, org.apache.maven.artifact.factory.ArtifactFactory, hudson.maven.MavenBuild) insteadIOExceptionpublic MavenArtifact.CloseableArtifact toCloseableArtifact(org.apache.maven.artifact.handler.manager.ArtifactHandlerManager handlerManager, org.apache.maven.artifact.factory.ArtifactFactory factory, MavenBuild build) throws IOException
Artifact back from the persisted data.IOException@Deprecated public File getFile(MavenBuild build) throws IOException
StandardArtifactManager and subclasses; use getTemporaryFile(hudson.maven.MavenBuild) insteadFile representing the archived artifact.FileNotFoundException - if the archived artifact was missingIOException@Nonnull public MavenArtifact.TemporaryFile getTemporaryFile(MavenBuild build)
build - a Maven build that might have archived thispublic org.kohsuke.stapler.HttpResponse doFile(@AncestorInPath
MavenArtifactRecord parent)
throws IOException
IOExceptionpublic void archive(MavenBuildProxy build, File file, hudson.model.BuildListener listener) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic hudson.model.Api getApi()
Copyright © 2016–2017. All rights reserved.