Book Image

Mastering Apache Maven 3

Book Image

Mastering Apache Maven 3

Overview of this book

Table of Contents (16 chapters)
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

The assembly descriptor


The assembly descriptor is an XML-based configuration, which defines how to build an assembly and how its content should be structured.

If we go back to our example, the attached goal of the assembly plugin creates a binary distribution according to the assembly descriptor, both in the test and package phases of the default Maven lifecycle. The assembly descriptors for each phase can be specified under the descriptors element. As in this particular example, there can be multiple descriptor elements defined under the descriptors parent element. For the package phase, it has the following three assembly descriptors:

<descriptors>
  <descriptor>src/assembly/bin.xml</descriptor>
  <descriptor>src/assembly/src.xml</descriptor>
  <descriptor>src/assembly/docs.xml</descriptor>
</descriptors>

Each descriptor element instructs the assembly plugin where to load the descriptor, and each descriptor file will be executed sequentially...