assembly Assembly Maven Assembly Plugin relies on the provided assembly descriptors to dictate its execution. Although there are already prefabricated descriptors available for use, they can only suffice some of the common assembly requirements.

So in order for you to customize the way the Assembly Plugin creates your assemblies, you need to know how to use the Assembly Descriptor.

This descriptor specifies the type of assembly archive to create, the contents of the assembly, and the ways in which dependencies or its modules are bundled with an assembly.

]]>
package org.apache.maven.plugin.assembly.model Assembly 1.0.0+ id 1.0.0+ true String Sets the id of this assembly. This is a symbolic name for a particular assembly of files from this project. Also, aside from being used to distinctly name the assembled package by attaching its value to the generated archive, the id is used as your artifact's classifier when deploying. formats 1.0.0+ false String *
  • "zip" - Creates a ZIP file format
  • "tar" - Creates a TAR format
  • "tar.gz" or "tgz" - Creates a gzip'd TAR format
  • "tar.bz2" or "tbz2" - Creates a bzip'd TAR format
  • "jar" - Creates a JAR format
  • "dir" - Creates an exploded directory format
  • "war" - Creates a WAR format
  • ]]>
    includeBaseDirectory boolean true Includes a base directory in the final archive. For example, if you are creating an assembly named "your-app", setting includeBaseDirectory to true will create an archive that includes this base directory. If this option is set to false the archive created will unzip its content to the current directory. baseDirectory 1.1.0+ String Sets the base directory of the resulting assembly archive. If this is not set and includeBaseDirectory == true, ${project.build.finalName} will be used instead. (Since 2.2-beta-1) includeSiteDirectory boolean false Includes a site directory in the final archive. The site directory location of a project is determined by the siteDirectory parameter of the Assembly Plugin. containerDescriptorHandlers 1.1.0+ ContainerDescriptorHandlerConfig * moduleSets 1.0.0+ ModuleSet * fileSets 1.0.0+ FileSet * files 1.0.0+ FileItem * dependencySets 1.0.0+ DependencySet * repositories 1.0.0+ Repository * componentDescriptors 1.0.0+ String * descriptor components for more information. A componentDescriptor is specified by providing one or more of <componentDescriptor> subelements. ]]>
    FileSet 1.0.0+ A fileSet allows the inclusion of groups of files into the assembly. useDefaultExcludes 1.1.0+ boolean true Whether standard exclusion patterns, such as those matching CVS and Subversion metadata files, should be used when calculating the files affected by this set. For backward compatibility, the default value is true. (Since 2.2-beta-1) outputDirectory 1.0.0+ String Sets the output directory relative to the root of the root directory of the assembly. For example, "log" will put the specified files in the log directory. includes 1.0.0+ String * excludes 1.0.0+ String * fileMode 1.0.0+ String (more on unix-style permissions) ]]> directoryMode 1.0.0+ String (more on unix-style permissions) ]]> directory 1.0.0+ String Sets the absolute or relative location from the module's directory. For example, "src/main/bin" would select this subdirectory of the project in which this dependency is defined. true lineEnding 1.0.0+ String
  • "keep" - Preserve all line endings
  • "unix" - Use Unix-style line endings (i.e. "\n")
  • "lf" - Use a single line-feed line endings (i.e. "\n")
  • "dos" - Use DOS-/Windows-style line endings (i.e. "\r\n")
  • "windows" - Use DOS-/Windows-style line endings (i.e. "\r\n")
  • "crlf" - Use carriage-return, line-feed line endings (i.e. "\r\n")
  • ]]>
    filtered 1.1.0+ Whether to filter symbols in the files as they are copied, using properties from the build configuration. (Since 2.2-beta-1) false boolean
    FileItem 1.0.0+ A file allows individual file inclusion with the option to change the destination filename not supported by fileSets. source 1.0.0+ String true Sets the absolute or relative path from the module's directory of the file to be included in the assembly. outputDirectory 1.0.0+ String false Sets the output directory relative to the root of the root directory of the assembly. For example, "log" will put the specified files in the log directory. destName 1.0.0+ String Sets the destination filename in the outputDirectory. Default is the same name as the source's file. fileMode 1.0.0+ String (more on unix-style permissions) ]]> lineEnding 1.0.0+ String
  • "keep" - Preserve all line endings
  • "unix" - Use Unix-style line endings (i.e. "\n")
  • "lf" - Use a single line-feed line endings (i.e. "\n")
  • "dos" - Use DOS-/Windows-style line endings (i.e. "\r\n")
  • "windows" - Use DOS-/Windows-style line endings (i.e. "\r\n")
  • "crlf" - Use carriage-return, line-feed line endings (i.e. "\r\n")
  • ]]>
    filtered 1.0.0+ boolean Sets whether to determine if the file is filtered.
    DependencySet 1.0.0+ A dependencySet allows inclusion and exclusion of project dependencies in the assembly. outputDirectory 1.0.0+ String Sets the output directory relative to the root of the root directory of the assembly. For example, "log" will put the specified files in the log directory, directly beneath the root of the archive. includes 1.0.0+ String * excludes 1.0.0+ String * fileMode 1.0.0+ String (more on unix-style permissions) ]]> directoryMode 1.0.0+ String (more on unix-style permissions) ]]> useStrictFiltering 1.1.2+ boolean false When specified as true, any include/exclude patterns which aren't used to filter an actual artifact during assembly creation will cause the build to fail with an error. This is meant to highlight obsolete inclusions or exclusions, or else signal that the assembly descriptor is incorrectly configured. (Since 2.2) outputFileNameMapping 1.0.0+ String ${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension} Sets the mapping pattern for all dependencies included in this assembly. (Since 2.2-beta-2; 2.2-beta-1 uses ${artifactId}-${version}${dashClassifier?}.${extension} as default value). See the plugin FAQ for more details about entries usable in the outputFileNameMapping parameter. unpack 1.0.0+ boolean false If set to true, this property will unpack all dependencies into the specified output directory. When set to false dependencies will be includes as archives (jars). Can only unpack jar, zip, tar.gz, and tar.bz archives. unpackOptions 1.1.0+ Allows the specification of includes and excludes, along with filtering options, for items unpacked from a dependency artifact. (Since 2.2-beta-1) UnpackOptions scope 1.0.0+ String runtime true Sets the dependency scope for this dependencySet. useProjectArtifact 1.1.0+ boolean true useProjectAttachments 1.1.0+ boolean false useTransitiveDependencies 1.1.0+ boolean true Determines whether transitive dependencies will be included in the processing of the current dependency set. If true, includes/excludes/useTransitiveFiltering will apply to transitive dependency artifacts in addition to the main project dependency artifacts. If false, useTransitiveFiltering is meaningless, and includes/excludes only affect the immediate dependencies of the project. By default, this value is true. (Since 2.2-beta-1) useTransitiveFiltering 1.1.0+ boolean false Determines whether the include/exclude patterns in this dependency set will be applied to the transitive path of a given artifact. If true, and the current artifact is a transitive dependency brought in by another artifact which matches an inclusion or exclusion pattern, then the current artifact has the same inclusion/exclusion logic applied to it as well. By default, this value is false, in order to preserve backward compatibility with version 2.1. This means that includes/excludes only apply directly to the current artifact, and not to the transitive set of artifacts which brought it in. (Since 2.2-beta-1) ModuleSet NOTE: When using <moduleSets> from the command-line, it is required to pass first the package phase by doing: "mvn package assembly:assembly". This bug/issue is scheduled to be addressed by Maven 2.1. ]]> 1.0.0+ useAllReactorProjects 1.1.2+ boolean false If set to true, the plugin will include all projects in the current reactor for processing in this ModuleSet. These will be subject to include/exclude rules. (Since 2.2) includeSubModules 1.1.0+ boolean true If set to false, the plugin will exclude sub-modules from processing in this ModuleSet. Otherwise, it will process all sub-modules, each subject to include/exclude rules. (Since 2.2-beta-1) includes 1.0.0+ String * excludes 1.0.0+ String * sources 1.0.0+ When this is present, the plugin will include the source files of the included modules from this set in the resulting assembly. ModuleSources binaries 1.0.0+ When this is present, the plugin will include the binaries of the included modules from this set in the resulting assembly. ModuleBinaries ModuleSources 1.0.0+ Contains configuration options for including the source files of a project module in an assembly. useDefaultExcludes 1.1.0+ boolean true Whether standard exclusion patterns, such as those matching CVS and Subversion metadata files, should be used when calculating the files affected by this set. For backward compatibility, the default value is true. (Since 2.2-beta-1) outputDirectory 1.0.0+ String Sets the output directory relative to the root of the root directory of the assembly. For example, "log" will put the specified files in the log directory. includes 1.0.0+ String * excludes 1.0.0+ String * fileMode 1.0.0+ String (more on unix-style permissions) ]]> directoryMode 1.0.0+ String (more on unix-style permissions) ]]> fileSets 1.1.0+ FileSet * includeModuleDirectory 1.1.0+ boolean true excludeSubModuleDirectories 1.1.0+ boolean true outputDirectoryMapping 1.1.0+ String ${module.artifactId} Sets the mapping pattern for all module base-directories included in this assembly. NOTE: This field is only used if includeModuleDirectory == true. Default is the module's ${artifactId} in 2.2-beta-1, and ${module.artifactId} in subsequent versions. (Since 2.2-beta-1) ModuleBinaries 1.0.0+ Contains configuration options for including the binary files of a project module in an assembly. outputDirectory 1.0.0+ String Sets the output directory relative to the root of the root directory of the assembly. For example, "log" will put the specified files in the log directory, directly beneath the root of the archive. includes 1.0.0+ String * excludes 1.0.0+ String * fileMode 1.0.0+ String (more on unix-style permissions) ]]> directoryMode 1.0.0+ String (more on unix-style permissions) ]]> attachmentClassifier 1.1.0+ String When specified, the attachmentClassifier will cause the assembler to look at artifacts attached to the module instead of the main project artifact. If it can find an attached artifact matching the specified classifier, it will use it; otherwise, it will throw an exception. (Since 2.2-beta-1) includeDependencies 1.0.0+ boolean true If set to true, the plugin will include the direct and transitive dependencies of of the project modules included here. Otherwise, it will only include the module packages only. dependencySets 1.1.0+ DependencySet * unpack 1.0.0+ boolean true If set to true, this property will unpack all module packages into the specified output directory. When set to false module packages will be included as archives (jars). unpackOptions 1.1.0+ Allows the specification of includes and excludes, along with filtering options, for items unpacked from a module artifact. (Since 2.2-beta-1) UnpackOptions outputFileNameMapping 1.0.0+ String ${module.artifactId}-${module.version}${dashClassifier?}.${module.extension} Sets the mapping pattern for all NON-UNPACKED dependencies included in this assembly. (Since 2.2-beta-2; 2.2-beta-1 uses ${artifactId}-${version}${dashClassifier?}.${extension} as default value) NOTE: If the dependencySet specifies unpack == true, outputFileNameMapping WILL NOT BE USED; in these cases, use outputDirectory. See the plugin FAQ for more details about entries usable in the outputFileNameMapping parameter. Repository 1.0.0+ NOTE: Currently, only artifacts from the central repository are allowed. ]]> outputDirectory 1.0.0+ String Sets the output directory relative to the root of the root directory of the assembly. For example, "log" will put the specified files in the log directory, directly beneath the root of the archive. includes 1.0.0+ String * excludes 1.0.0+ String * fileMode 1.0.0+ String (more on unix-style permissions) ]]> directoryMode 1.0.0+ String (more on unix-style permissions) ]]> includeMetadata 1.0.0+ boolean false If set to true, this property will trigger the creation of repository metadata which will allow the repository to be used as a functional remote repository. groupVersionAlignments 1.0.0+ GroupVersionAlignment * scope 1.1.0+ String runtime true Specifies the scope for artifacts included in this repository. (Since 2.2-beta-1) GroupVersionAlignment 1.0.0+ Allows a group of artifacts to be aligned to a specified version. id 1.0.0+ String The groupId of the artifacts for which you want to align the versions. version 1.0.0+ String The version you want to align this group to. excludes 1.0.0+ String * UnpackOptions 1.1.0+ Specifies options for including/excluding/filtering items extracted from an archive. (Since 2.2-beta-1) includes 1.1.0+ String * excludes 1.1.0+ String * filtered 1.1.0+ Whether to filter symbols in the files as they are unpacked from the archive, using properties from the build configuration. (Since 2.2-beta-1) false boolean lineEnding 1.1.2+ String
  • "keep" - Preserve all line endings
  • "unix" - Use Unix-style line endings
  • "lf" - Use a single line-feed line endings
  • "dos" - Use DOS-style line endings
  • "crlf" - Use Carraige-return, line-feed line endings
  • ]]>
    useDefaultExcludes 1.1.2+ boolean true Whether standard exclusion patterns, such as those matching CVS and Subversion metadata files, should be used when calculating the files affected by this set. For backward compatibility, the default value is true. (Since 2.2) encoding 1.1.3+ String
    ContainerDescriptorHandlerConfig 1.1.0+ Configures a filter for files headed into the assembly archive, to enable aggregation of various types of descriptor fragments, such as components.xml, web.xml, etc. handlerName 1.1.0+ The handler's plexus role-hint, for lookup from the container. String true configuration 1.1.1+ Configuration options for the handler. DOM