public class MavenArchiver extends Object
MavenArchiver class.
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)
Deprecated.
Use
configureReproducibleBuild(String) instead. |
void |
configureReproducibleBuild(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)
createArchive.
|
org.codehaus.plexus.archiver.jar.JarArchiver |
getArchiver()
Getter for the field
archiver . |
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)
getManifest.
|
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)
getManifest.
|
org.codehaus.plexus.archiver.jar.Manifest |
getManifest(org.apache.maven.execution.MavenSession session,
org.apache.maven.project.MavenProject project,
MavenArchiveConfiguration config)
getManifest.
|
static Optional<Instant> |
parseBuildOutputTimestamp(String outputTimestamp)
Parse output timestamp configured for Reproducible Builds' archive entries.
|
Date |
parseOutputTimestamp(String outputTimestamp)
Deprecated.
Use
parseBuildOutputTimestamp(String) instead. |
void |
setArchiver(org.codehaus.plexus.archiver.jar.JarArchiver archiver)
Setter for the field
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)
setOutputFile.
|
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
getManifest.
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
getManifest.
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
getManifest.
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()
Getter for the field archiver
.
JarArchiver
public void setArchiver(org.codehaus.plexus.archiver.jar.JarArchiver archiver)
Setter for the field archiver
.
archiver
- JarArchiver
public void setOutputFile(File outputFile)
setOutputFile.
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
createArchive.
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" entry@Deprecated public Date parseOutputTimestamp(String outputTimestamp)
parseBuildOutputTimestamp(String)
instead.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 integer, or it's not within
the valid range 1980-01-01T00:00:02Z to 2099-12-31T23:59:59Z@Deprecated public Date configureReproducible(String outputTimestamp)
configureReproducibleBuild(String)
instead.outputTimestamp
- the value of ${project.build.outputTimestamp}
(may be null
)Date
parseOutputTimestamp(java.lang.String)
public static Optional<Instant> parseBuildOutputTimestamp(String outputTimestamp)
Either as DateTimeFormatter.ISO_OFFSET_DATE_TIME
or as a number representing seconds
since the epoch (like SOURCE_DATE_EPOCH).
outputTimestamp
- the value of ${project.build.outputTimestamp}
(may be null
)Optional<Instant>
, empty
if input is null
or input
contains only 1 character (not a number)IllegalArgumentException
- if the outputTimestamp is neither ISO 8601 nor an integer, or it's not within
the valid range 1980-01-01T00:00:02Z to 2099-12-31T23:59:59Z as defined by
ZIP application note,
section 4.4.6.public void configureReproducibleBuild(String outputTimestamp)
outputTimestamp
- the value of project.build.outputTimestamp
(may be null
)parseBuildOutputTimestamp(String)
Copyright © 2002–2024 The Apache Software Foundation. All rights reserved.