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.plugins.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+ true String *
  • "zip" - Creates a ZIP file format
  • "gz" - Creates a GZIP format
  • "tar" - Creates a TAR format
  • "tar.gz" - Creates a gzip'd TAR format
  • "tar.bz2 - Creates a bzip'd TAR 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. Default value is true. 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. 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. Default value is false. 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. ]]>
    SetBase 1.0.0+ 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. 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 0644 (more on unix-style permissions) ]]> directoryMode 1.0.0+ String 0755 (more on unix-style permissions) ]]> FileSet 1.0.0+ SetBase A fileSet allows the inclusion of groups of files into the assembly. 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
  • "lf" - Use a single line-feed line endings
  • "dos" - Use DOS-style line endings
  • "crlf" - Use Carraige-return, line-feed line endings
  • ]]>
    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 0644 (more on unix-style permissions) ]]> lineEnding 1.0.0+ 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
  • ]]>
    filtered 1.0.0+ boolean Sets whether to determine if the file is filtered.
    DependencySet 1.0.0+ SetBase A dependencySet allows inclusion and exclusion of project dependencies in the assembly. outputFileNameMapping 1.0.0+ String ${artifactId}-${version}.${extension} Sets the mapping pattern for all dependencies included in this assembly. Default is ${artifactId}-${version}.${extension}. unpack 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. Default value is false. scope 1.0.0+ String runtime true Sets the dependency scope for this dependencySet. Default scope value is "runtime". 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+ 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. Default value is true. 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+ SetBase Contains configuration options for including the source files of a project module in an assembly. fileSets 1.1.0 FileSet * includeModuleDirectory 1.1.0 boolean true excludeSubModuleDirectories 1.1.0 boolean true outputDirectoryMapping 1.1.0 String ${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}. ModuleBinaries 1.0.0+ SetBase Contains configuration options for including the binary files of a project module in an assembly. includeDependencies 1.0.0+ boolean false 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. Default value is false. dependencySets 1.1.0 DependencySet * unpack 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). Default value is true. outputFileNameMapping 1.0.0+ String ${artifactId}-${version}.${extension} Sets the mapping pattern for all dependencies included in this assembly. Default is ${artifactId}-${version}.${extension}. Repository 1.0.0+ SetBase NOTE: Currently, only artifacts from the central repository are allowed. ]]> 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. Default value is false. groupVersionAlignments 1.0.0+ GroupVersionAlignment * scope 1.1.0 String runtime true Specifies the scope for artifacts included in this repository. Default scope value is "runtime". 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 *