public class MavenArchiver extends Object
Modifier and Type | Field and Description |
---|---|
static String |
REPOSITORY_LAYOUT
Repository layout.
|
static String |
REPOSITORY_LAYOUT_NONUNIQUE
Repository layout non unique.
|
static String |
SIMPLE_LAYOUT
The simply layout.
|
static String |
SIMPLE_LAYOUT_NONUNIQUE
simple layout non unique.
|
Constructor and Description |
---|
MavenArchiver() |
Modifier and Type | Method and Description |
---|---|
Date |
configureReproducible(String outputTimestamp)
Configure Reproducible Builds archive creation if a timestamp is provided.
|
void |
createArchive(org.apache.maven.execution.MavenSession session,
org.apache.maven.project.MavenProject project,
MavenArchiveConfiguration archiveConfiguration) |
org.codehaus.plexus.archiver.jar.JarArchiver |
getArchiver() |
org.codehaus.plexus.archiver.jar.Manifest |
getManifest(org.apache.maven.project.MavenProject project,
ManifestConfiguration config)
Return a pre-configured manifest.
|
org.codehaus.plexus.archiver.jar.Manifest |
getManifest(org.apache.maven.execution.MavenSession mavenSession,
org.apache.maven.project.MavenProject project,
ManifestConfiguration config) |
protected org.codehaus.plexus.archiver.jar.Manifest |
getManifest(org.apache.maven.execution.MavenSession session,
org.apache.maven.project.MavenProject project,
ManifestConfiguration config,
Map<String,String> entries) |
org.codehaus.plexus.archiver.jar.Manifest |
getManifest(org.apache.maven.execution.MavenSession session,
org.apache.maven.project.MavenProject project,
MavenArchiveConfiguration config) |
Date |
parseOutputTimestamp(String outputTimestamp)
Parse output timestamp configured for Reproducible Builds' archive entries, either formatted as ISO 8601
yyyy-MM-dd'T'HH:mm:ssXXX or as an int representing seconds since the epoch (like
SOURCE_DATE_EPOCH. |
void |
setArchiver(org.codehaus.plexus.archiver.jar.JarArchiver archiver) |
void |
setBuildJdkSpecDefaultEntry(boolean buildJdkSpecDefaultEntry)
Add "Build-Jdk-Spec" entry as part of default manifest entries (true by default).
|
void |
setCreatedBy(String description,
String groupId,
String artifactId)
Define a value for "Created By" entry.
|
void |
setOutputFile(File outputFile) |
public static final String SIMPLE_LAYOUT
public static final String REPOSITORY_LAYOUT
public static final String SIMPLE_LAYOUT_NONUNIQUE
public static final String REPOSITORY_LAYOUT_NONUNIQUE
public org.codehaus.plexus.archiver.jar.Manifest getManifest(org.apache.maven.execution.MavenSession session, org.apache.maven.project.MavenProject project, MavenArchiveConfiguration config) throws org.codehaus.plexus.archiver.jar.ManifestException, org.apache.maven.artifact.DependencyResolutionRequiredException
session
- the Maven Sessionproject
- the Maven Projectconfig
- the MavenArchiveConfigurationManifest
org.codehaus.plexus.archiver.jar.ManifestException
- in case of a failureorg.apache.maven.artifact.DependencyResolutionRequiredException
- resolution failurepublic org.codehaus.plexus.archiver.jar.Manifest getManifest(org.apache.maven.project.MavenProject project, ManifestConfiguration config) throws org.codehaus.plexus.archiver.jar.ManifestException, org.apache.maven.artifact.DependencyResolutionRequiredException
project
- MavenProject
config
- ManifestConfiguration
Manifest
org.codehaus.plexus.archiver.jar.ManifestException
- Manifest exception.org.apache.maven.artifact.DependencyResolutionRequiredException
- Dependency resolution exception.public org.codehaus.plexus.archiver.jar.Manifest getManifest(org.apache.maven.execution.MavenSession mavenSession, org.apache.maven.project.MavenProject project, ManifestConfiguration config) throws org.codehaus.plexus.archiver.jar.ManifestException, org.apache.maven.artifact.DependencyResolutionRequiredException
mavenSession
- MavenSession
project
- MavenProject
config
- ManifestConfiguration
Manifest
org.codehaus.plexus.archiver.jar.ManifestException
- the manifest exceptionorg.apache.maven.artifact.DependencyResolutionRequiredException
- the dependency resolution required exceptionprotected org.codehaus.plexus.archiver.jar.Manifest getManifest(org.apache.maven.execution.MavenSession session, org.apache.maven.project.MavenProject project, ManifestConfiguration config, Map<String,String> entries) throws org.codehaus.plexus.archiver.jar.ManifestException, org.apache.maven.artifact.DependencyResolutionRequiredException
session
- MavenSession
project
- MavenProject
config
- ManifestConfiguration
entries
- The entries.Manifest
org.codehaus.plexus.archiver.jar.ManifestException
- the manifest exceptionorg.apache.maven.artifact.DependencyResolutionRequiredException
- the dependency resolution required exceptionpublic org.codehaus.plexus.archiver.jar.JarArchiver getArchiver()
JarArchiver
public void setArchiver(org.codehaus.plexus.archiver.jar.JarArchiver archiver)
archiver
- JarArchiver
public void setOutputFile(File outputFile)
outputFile
- Set output file.public void createArchive(org.apache.maven.execution.MavenSession session, org.apache.maven.project.MavenProject project, MavenArchiveConfiguration archiveConfiguration) throws org.codehaus.plexus.archiver.jar.ManifestException, IOException, org.apache.maven.artifact.DependencyResolutionRequiredException
session
- MavenSession
project
- MavenProject
archiveConfiguration
- MavenArchiveConfiguration
org.codehaus.plexus.archiver.ArchiverException
- Archiver Exception.org.codehaus.plexus.archiver.jar.ManifestException
- Manifest Exception.IOException
- IO Exception.org.apache.maven.artifact.DependencyResolutionRequiredException
- Dependency resolution exception.public void setCreatedBy(String description, String groupId, String artifactId)
description
- description of the plugin, like "Maven Source Plugin"groupId
- groupId where to get version in pom.propertiesartifactId
- artifactId where to get version in pom.propertiespublic void setBuildJdkSpecDefaultEntry(boolean buildJdkSpecDefaultEntry)
buildJdkSpecDefaultEntry
- the value for "Build-Jdk-Spec" entrypublic Date parseOutputTimestamp(String outputTimestamp)
yyyy-MM-dd'T'HH:mm:ssXXX
or as an int representing seconds since the epoch (like
SOURCE_DATE_EPOCH.outputTimestamp
- the value of ${project.build.outputTimestamp}
(may be null
)null
if null
input or input contains only 1
characterIllegalArgumentException
- if the outputTimestamp is neither ISO 8601 nor an integerpublic Date configureReproducible(String outputTimestamp)
outputTimestamp
- the value of ${project.build.outputTimestamp}
(may be null
)parseOutputTimestamp(java.lang.String)
Copyright © 2002–2023 The Apache Software Foundation. All rights reserved.