public abstract class AbstractAssemblyMojo extends org.apache.maven.plugin.AbstractMojo implements AssemblerConfigurationSource
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
appendAssemblyId
Set to false to exclude the assembly id from the assembly final name, and to create the resultant assembly
artifacts without classifier.
|
private org.apache.maven.archiver.MavenArchiveConfiguration |
archive
This is a set of instructions to the archive builder, especially for building .jar files.
|
private java.io.File |
archiveBaseDirectory
This is the base directory from which archive files are created.
|
private org.codehaus.plexus.configuration.PlexusConfiguration |
archiverConfig
Allows additional configuration options that are specific to a particular type of archive format.
|
private AssemblyArchiver |
assemblyArchiver |
private AssemblyReader |
assemblyReader |
private boolean |
attach
Controls whether the assembly plugin tries to attach the resulting assembly to the project.
|
private java.io.File |
basedir
Base directory of the project.
|
protected org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator |
commanndLinePropertiesInterpolator |
private java.util.List<java.lang.String> |
delimiters
Set of delimiters for expressions to filter within the resources.
|
private java.lang.String[] |
descriptorRefs
A list of references to assembly descriptors available on the plugin's classpath.
|
private java.lang.String[] |
descriptors
A list of descriptor files to generate from.
|
private java.io.File |
descriptorSourceDirectory
Directory to scan for descriptor files in.
|
private boolean |
dryRun
If this flag is set, everything up to the call to Archiver.createArchive() will be executed.
|
private java.lang.String |
encoding
The character encoding scheme to be applied when filtering resources.
|
protected org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator |
envInterpolator |
private java.lang.String |
escapeString
Expressions preceded with this String won't be interpolated.
|
private java.util.List<java.lang.String> |
filters
The list of extra filter properties files to be used along with System properties, project
properties, and filter properties files specified in the POM build/filters section, which
should be used for the filtering during the current mojo execution.
|
private java.lang.String |
finalName
The filename of the assembled distribution file.
|
private java.util.List<java.lang.String> |
formats
Specifies the formats of the assembly.
|
private boolean |
ignoreDirFormatExtensions
If this flag is set, the ".dir" suffix will be suppressed in the output directory name when using assembly/format
== 'dir' and other formats that begin with 'dir'.
|
private boolean |
ignoreMissingDescriptor
Set to true in order to not fail when a descriptor is missing.
|
private boolean |
ignorePermissions
Set to
true in order to avoid all chmod calls. |
private boolean |
includeProjectBuildFilters
If True (default) then the ${project.build.filters} are also used in addition to any
further filters defined for the Assembly.
|
private org.apache.maven.artifact.repository.ArtifactRepository |
localRepository
Local Maven repository where artifacts are cached during the build process.
|
protected org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator |
mainProjectInterpolator |
private org.apache.maven.shared.filtering.MavenReaderFilter |
mavenReaderFilter
Maven shared filtering utility.
|
private org.apache.maven.execution.MavenSession |
mavenSession
The Maven Session Object
|
private java.lang.String |
mergeManifestMode
sets the merge manifest mode in the JarArchiver
|
private java.io.File |
outputDirectory
The output directory of the assembled distribution file.
|
private org.apache.maven.project.MavenProjectHelper |
projectHelper
Maven ProjectHelper.
|
private java.util.List<org.apache.maven.project.MavenProject> |
reactorProjects
Contains the full list of projects in the reactor.
|
private boolean |
recompressZippedFiles
Indicates if zip archives (jar,zip etc) being added to the assembly should be compressed again.
|
private java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> |
remoteRepositories |
protected org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator |
rootInterpolator |
private boolean |
runOnlyAtExecutionRoot
This will cause the assembly to run only at the top of a given module tree.
|
private java.io.File |
siteDirectory
Directory for site generated.
|
private boolean |
skipAssembly
Flag allowing one or more executions of the assembly plugin to be configured as skipped for a particular build.
|
private java.lang.String |
tarLongFileMode
Sets the TarArchiver behavior on file paths with more than 100 characters length.
|
private java.io.File |
tempRoot
Temporary directory that contain the files to be assembled.
|
private boolean |
updateOnly
This will cause the assembly to only update an existing archive, if it exists.
|
private boolean |
useJvmChmod
will use the jvm chmod, this is available for user and all level group level will be ignored As of
assembly-plugin 2.5, this flag is ignored for users of java7+
|
private java.io.File |
workDirectory
Directory to unpack JARs into if needed
|
Constructor and Description |
---|
AbstractAssemblyMojo() |
Modifier and Type | Method and Description |
---|---|
private org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator |
createCommandLinePropertiesInterpolator() |
private org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator |
createEnvInterpolator() |
private org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator |
createRepositoryInterpolator() |
void |
execute()
Create the binary distribution.
|
java.io.File |
getArchiveBaseDirectory() |
java.lang.String |
getArchiverConfig() |
java.io.File |
getBasedir() |
org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator |
getCommandLinePropsInterpolator()
Gets an interpolator from environment variables and stuff
|
java.util.List<java.lang.String> |
getDelimiters() |
java.lang.String[] |
getDescriptorReferences() |
java.lang.String[] |
getDescriptors() |
java.io.File |
getDescriptorSourceDirectory() |
java.lang.String |
getEncoding() |
org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator |
getEnvInterpolator()
Gets an interpolator from environment variables and stuff
|
java.lang.String |
getEscapeString() |
java.util.List<java.lang.String> |
getFilters() |
java.lang.String |
getFinalName() |
org.apache.maven.archiver.MavenArchiveConfiguration |
getJarArchiveConfiguration() |
org.apache.maven.artifact.repository.ArtifactRepository |
getLocalRepository() |
org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator |
getMainProjectInterpolator() |
org.apache.maven.shared.filtering.MavenReaderFilter |
getMavenReaderFilter()
Maven shared filtering utility.
|
org.apache.maven.execution.MavenSession |
getMavenSession() |
java.lang.String |
getMergeManifestMode() |
java.io.File |
getOutputDirectory() |
abstract org.apache.maven.project.MavenProject |
getProject() |
java.util.List<org.apache.maven.project.MavenProject> |
getReactorProjects() |
java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> |
getRemoteRepositories() |
org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator |
getRepositoryInterpolator() |
java.io.File |
getSiteDirectory() |
java.lang.String |
getTarLongFileMode() |
java.io.File |
getTemporaryRootDirectory() |
java.io.File |
getWorkingDirectory() |
boolean |
isAssemblyIdAppended() |
boolean |
isDryRun() |
boolean |
isIgnoreDirFormatExtensions() |
boolean |
isIgnoreMissingDescriptor() |
boolean |
isIgnorePermissions() |
boolean |
isIncludeProjectBuildFilters() |
(package private) boolean |
isRecompressZippedFiles() |
(package private) boolean |
isThisTheExecutionRoot()
Returns true if the current project is located at the Execution Root Directory (where mvn was launched)
|
boolean |
isUpdateOnly() |
boolean |
isUseJvmChmod() |
static org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator |
mainProjectInterpolator(org.apache.maven.project.MavenProject mainProject) |
void |
setAppendAssemblyId(boolean appendAssemblyId) |
void |
setArchive(org.apache.maven.archiver.MavenArchiveConfiguration archive) |
void |
setBasedir(java.io.File basedir) |
void |
setDelimiters(java.util.List<java.lang.String> delimiters) |
void |
setDescriptorRefs(java.lang.String[] descriptorRefs) |
void |
setDescriptors(java.lang.String[] descriptors) |
void |
setFilters(java.util.List<java.lang.String> filters) |
void |
setFinalName(java.lang.String finalName) |
void |
setLocalRepository(org.apache.maven.artifact.repository.ArtifactRepository localRepository) |
void |
setOutputDirectory(java.io.File outputDirectory) |
void |
setReactorProjects(java.util.List<org.apache.maven.project.MavenProject> reactorProjects) |
void |
setSiteDirectory(java.io.File siteDirectory) |
void |
setTarLongFileMode(java.lang.String tarLongFileMode) |
void |
setTempRoot(java.io.File tempRoot) |
void |
setWorkDirectory(java.io.File workDirectory) |
protected org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator commanndLinePropertiesInterpolator
protected org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator envInterpolator
protected org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator mainProjectInterpolator
protected org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator rootInterpolator
@Parameter(property="assembly.appendAssemblyId", defaultValue="true") boolean appendAssemblyId
@Parameter(property="encoding", defaultValue="${project.build.sourceEncoding}") private java.lang.String encoding
@Parameter(property="assembly.escapeString") private java.lang.String escapeString
@Parameter(property="assembly.skipAssembly", defaultValue="false") private boolean skipAssembly
@Parameter(property="assembly.dryRun", defaultValue="false") private boolean dryRun
@Parameter(defaultValue="true") private boolean ignoreDirFormatExtensions
@Parameter(defaultValue="${localRepository}", required=true, readonly=true) private org.apache.maven.artifact.repository.ArtifactRepository localRepository
@Parameter(defaultValue="${project.remoteArtifactRepositories}", required=true, readonly=true) private java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepositories
@Parameter(defaultValue="${reactorProjects}", required=true, readonly=true) private java.util.List<org.apache.maven.project.MavenProject> reactorProjects
@Parameter(defaultValue="${project.build.directory}", required=true) private java.io.File outputDirectory
@Parameter(defaultValue="${project.build.finalName}", required=true, readonly=true) private java.lang.String finalName
@Parameter(defaultValue="${project.build.directory}/assembly/work", required=true) private java.io.File workDirectory
@Parameter private java.util.List<java.lang.String> formats
@Parameter private java.lang.String[] descriptors
@Parameter private java.lang.String[] descriptorRefs
bin
, jar-with-dependencies
, src
, and
project
. You can add others by adding dependencies
to the plugin.@Parameter private java.io.File descriptorSourceDirectory
@Parameter private java.io.File archiveBaseDirectory
<directory>
specifications in the assembly descriptor. This is an optional parameter.@Parameter(property="assembly.tarLongFileMode", defaultValue="warn") private java.lang.String tarLongFileMode
@Parameter(defaultValue="${project.basedir}", required=true, readonly=true) private java.io.File basedir
@Component private org.apache.maven.project.MavenProjectHelper projectHelper
@Component private org.apache.maven.shared.filtering.MavenReaderFilter mavenReaderFilter
@Parameter(defaultValue="${session}", readonly=true, required=true) private org.apache.maven.execution.MavenSession mavenSession
@Parameter(defaultValue="${project.build.directory}/archive-tmp", required=true, readonly=true) private java.io.File tempRoot
@Parameter(defaultValue="${project.reporting.outputDirectory}", readonly=true) private java.io.File siteDirectory
@Parameter(property="assembly.ignoreMissingDescriptor", defaultValue="false") private boolean ignoreMissingDescriptor
@Parameter private org.apache.maven.archiver.MavenArchiveConfiguration archive
@Parameter private java.util.List<java.lang.String> filters
@Parameter(property="assembly.includeProjectBuildFilters", defaultValue="true") private boolean includeProjectBuildFilters
@Parameter(property="assembly.attach", defaultValue="true") private boolean attach
@Parameter(defaultValue="true") private boolean recompressZippedFiles
@Parameter private java.lang.String mergeManifestMode
@Component private AssemblyArchiver assemblyArchiver
@Component private AssemblyReader assemblyReader
@Parameter private org.codehaus.plexus.configuration.PlexusConfiguration archiverConfig
<appxml>${project.basedir}/somepath/app.xml</appxml>
@Parameter(property="assembly.runOnlyAtExecutionRoot", defaultValue="false") private boolean runOnlyAtExecutionRoot
@Parameter(property="assembly.updateOnly", defaultValue="false") private boolean updateOnly
Note: The property that can be used on the command line was misspelled as "assembly.updatOnly" in versions prior to version 2.4.
@Parameter(property="assembly.useJvmChmod", defaultValue="false") private boolean useJvmChmod
will use the jvm chmod, this is available for user and all level group level will be ignored As of assembly-plugin 2.5, this flag is ignored for users of java7+
@Parameter(property="assembly.ignorePermissions", defaultValue="false") private boolean ignorePermissions
Set to true
in order to avoid all chmod calls.
NOTE: This will cause the assembly plugin to DISREGARD all fileMode/directoryMode settings in the assembly descriptor, and all file permissions in unpacked dependencies!
@Parameter private java.util.List<java.lang.String> delimiters
Set of delimiters for expressions to filter within the resources. These delimiters are specified in the form 'beginToken*endToken'. If no '*' is given, the delimiter is assumed to be the same for start and end.
So, the default filtering delimiters might be specified as:
<delimiters> <delimiter>${*}</delimiter> <delimiter>@</delimiter> </delimiters>
Since the '@' delimiter is the same on both ends, we don't need to specify '@*@' (though we can).
public static org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator mainProjectInterpolator(org.apache.maven.project.MavenProject mainProject)
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
execute
in interface org.apache.maven.plugin.Mojo
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
private org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator createRepositoryInterpolator()
private org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator createCommandLinePropertiesInterpolator()
private org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator createEnvInterpolator()
boolean isThisTheExecutionRoot()
public java.io.File getBasedir()
getBasedir
in interface AssemblerConfigurationSource
public void setBasedir(java.io.File basedir)
public java.lang.String[] getDescriptorReferences()
getDescriptorReferences
in interface AssemblerConfigurationSource
public java.io.File getDescriptorSourceDirectory()
getDescriptorSourceDirectory
in interface AssemblerConfigurationSource
public java.lang.String[] getDescriptors()
getDescriptors
in interface AssemblerConfigurationSource
public void setDescriptors(java.lang.String[] descriptors)
public abstract org.apache.maven.project.MavenProject getProject()
getProject
in interface AssemblerConfigurationSource
public java.io.File getSiteDirectory()
getSiteDirectory
in interface AssemblerConfigurationSource
public void setSiteDirectory(java.io.File siteDirectory)
public java.lang.String getFinalName()
getFinalName
in interface AssemblerConfigurationSource
public void setFinalName(java.lang.String finalName)
public boolean isAssemblyIdAppended()
isAssemblyIdAppended
in interface AssemblerConfigurationSource
public java.lang.String getTarLongFileMode()
getTarLongFileMode
in interface AssemblerConfigurationSource
public void setTarLongFileMode(java.lang.String tarLongFileMode)
public java.io.File getOutputDirectory()
getOutputDirectory
in interface AssemblerConfigurationSource
public void setOutputDirectory(java.io.File outputDirectory)
public org.apache.maven.archiver.MavenArchiveConfiguration getJarArchiveConfiguration()
getJarArchiveConfiguration
in interface AssemblerConfigurationSource
public java.io.File getWorkingDirectory()
getWorkingDirectory
in interface AssemblerConfigurationSource
public org.apache.maven.artifact.repository.ArtifactRepository getLocalRepository()
getLocalRepository
in interface AssemblerConfigurationSource
public void setLocalRepository(org.apache.maven.artifact.repository.ArtifactRepository localRepository)
public java.io.File getTemporaryRootDirectory()
getTemporaryRootDirectory
in interface AssemblerConfigurationSource
public java.io.File getArchiveBaseDirectory()
getArchiveBaseDirectory
in interface AssemblerConfigurationSource
public java.util.List<java.lang.String> getFilters()
getFilters
in interface AssemblerConfigurationSource
public void setFilters(java.util.List<java.lang.String> filters)
public boolean isIncludeProjectBuildFilters()
isIncludeProjectBuildFilters
in interface AssemblerConfigurationSource
public java.util.List<org.apache.maven.project.MavenProject> getReactorProjects()
getReactorProjects
in interface AssemblerConfigurationSource
public void setReactorProjects(java.util.List<org.apache.maven.project.MavenProject> reactorProjects)
public void setAppendAssemblyId(boolean appendAssemblyId)
public void setArchive(org.apache.maven.archiver.MavenArchiveConfiguration archive)
public void setDescriptorRefs(java.lang.String[] descriptorRefs)
public void setTempRoot(java.io.File tempRoot)
public void setWorkDirectory(java.io.File workDirectory)
public java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> getRemoteRepositories()
getRemoteRepositories
in interface AssemblerConfigurationSource
public boolean isDryRun()
isDryRun
in interface AssemblerConfigurationSource
public boolean isIgnoreDirFormatExtensions()
isIgnoreDirFormatExtensions
in interface AssemblerConfigurationSource
public boolean isIgnoreMissingDescriptor()
isIgnoreMissingDescriptor
in interface AssemblerConfigurationSource
public org.apache.maven.execution.MavenSession getMavenSession()
getMavenSession
in interface AssemblerConfigurationSource
public java.lang.String getArchiverConfig()
getArchiverConfig
in interface AssemblerConfigurationSource
public org.apache.maven.shared.filtering.MavenReaderFilter getMavenReaderFilter()
AssemblerConfigurationSource
getMavenReaderFilter
in interface AssemblerConfigurationSource
public boolean isUpdateOnly()
isUpdateOnly
in interface AssemblerConfigurationSource
public boolean isUseJvmChmod()
isUseJvmChmod
in interface AssemblerConfigurationSource
public boolean isIgnorePermissions()
isIgnorePermissions
in interface AssemblerConfigurationSource
public java.lang.String getEncoding()
getEncoding
in interface AssemblerConfigurationSource
boolean isRecompressZippedFiles()
public java.lang.String getMergeManifestMode()
public java.lang.String getEscapeString()
getEscapeString
in interface AssemblerConfigurationSource
public java.util.List<java.lang.String> getDelimiters()
getDelimiters
in interface AssemblerConfigurationSource
public void setDelimiters(java.util.List<java.lang.String> delimiters)
@Nonnull public org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator getCommandLinePropsInterpolator()
AssemblerConfigurationSource
getCommandLinePropsInterpolator
in interface AssemblerConfigurationSource
@Nonnull public org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator getEnvInterpolator()
AssemblerConfigurationSource
getEnvInterpolator
in interface AssemblerConfigurationSource
@Nonnull public org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator getRepositoryInterpolator()
getRepositoryInterpolator
in interface AssemblerConfigurationSource
@Nonnull public org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator getMainProjectInterpolator()
getMainProjectInterpolator
in interface AssemblerConfigurationSource