Creating an assembly
A typical project requirement is to aggregate the project output along with its dependencies, modules, and other files into a single distributable archive. An assembly is a group of files, directories, and dependencies that are assembled into an archive format and distributed. Maven provides prefabricated assembly descriptors to build these assemblies. The descriptors handle common operations, such as packaging a project's artifact, along with the dependencies.
Getting ready
Maven should be set up on your system and verified to work. To do this, refer to Chapter 1, Getting Started.
How to do it...
- Open a Maven project for which you want to generate the assembly; in our case,
project-with-assembly
. - Add the following plugin and configuration to the pom file:
<plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.5.3</version> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies...