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

Chapter 6. Maven Assemblies

Maven provides an extensible architecture via plugins and lifecycles. Archive types such as .jar, .war, .ear, and many more are supported by plugins and associated lifecycles. The JAR plugin creates an artifact with the .jar extension and the relevant metadata, according to the JAR specification. The JAR file is, in fact, a ZIP file with the optional META-INF directory. You can find more details about the JAR specification from http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html.

The JAR file aggregates a set of class files to build a single distribution unit. The WAR file aggregates a set of JAR files, Java classes, JSPs, images, and many more resources into a single distribution unit that can be deployed in a Java EE application server. However, when you build a product, you might need to aggregate many JAR files from different places, WAR files, README files, LICENSE files, and many more into a single ZIP file. To build such an archive, we can...