Book Image

Apache Maven Cookbook

Book Image

Apache Maven Cookbook

Overview of this book

Table of Contents (18 chapters)
Apache Maven Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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...

  1. Open a Maven project for which you want to generate the assembly; in our case, project-with-assembly.

  2. 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<...