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(MavenSession session,
MavenProject project,
MavenArchiveConfiguration archiveConfiguration) |
JarArchiver |
getArchiver() |
Manifest |
getManifest(MavenProject project,
ManifestConfiguration config)
Return a pre-configured manifest.
|
Manifest |
getManifest(MavenSession mavenSession,
MavenProject project,
ManifestConfiguration config) |
protected Manifest |
getManifest(MavenSession session,
MavenProject project,
ManifestConfiguration config,
Map<String,String> entries) |
Manifest |
getManifest(MavenSession session,
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(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 Manifest getManifest(MavenSession session, MavenProject project, MavenArchiveConfiguration config) throws ManifestException, DependencyResolutionRequiredException
session - the Maven Sessionproject - the Maven Projectconfig - the MavenArchiveConfigurationManifestManifestException - in case of a failureDependencyResolutionRequiredException - resolution failurepublic Manifest getManifest(MavenProject project, ManifestConfiguration config) throws ManifestException, DependencyResolutionRequiredException
project - MavenProjectconfig - ManifestConfigurationManifestManifestException - Manifest exception.DependencyResolutionRequiredException - Dependency resolution exception.public Manifest getManifest(MavenSession mavenSession, MavenProject project, ManifestConfiguration config) throws ManifestException, DependencyResolutionRequiredException
mavenSession - MavenSessionproject - MavenProjectconfig - ManifestConfigurationManifestManifestException - the manifest exceptionDependencyResolutionRequiredException - the dependency resolution required exceptionprotected Manifest getManifest(MavenSession session, MavenProject project, ManifestConfiguration config, Map<String,String> entries) throws ManifestException, DependencyResolutionRequiredException
session - MavenSessionproject - MavenProjectconfig - ManifestConfigurationentries - The entries.ManifestManifestException - the manifest exceptionDependencyResolutionRequiredException - the dependency resolution required exceptionpublic JarArchiver getArchiver()
JarArchiverpublic void setArchiver(JarArchiver archiver)
archiver - JarArchiverpublic void setOutputFile(File outputFile)
outputFile - Set output file.public void createArchive(MavenSession session, MavenProject project, MavenArchiveConfiguration archiveConfiguration) throws ManifestException, IOException, DependencyResolutionRequiredException
session - MavenSessionproject - MavenProjectarchiveConfiguration - MavenArchiveConfigurationArchiverException - Archiver Exception.ManifestException - Manifest Exception.IOException - IO Exception.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–2022 The Apache Software Foundation. All rights reserved.