Packaging types

It's time to introduce one of the most important Maven concepts: how plugin goals are tied to lifecycle phases. This happens through packaging types. The packaging type is specified in the pom.xml descriptor through the <packaging> element, usually after its Maven coordinates. The default packaging type is jar. The plugin goals that are executed by default in each phase of the lifecycle depend on the packaging type of the project that we will build. This is because we need to execute different tasks for different packaging types. Let's see some details about the most common packaging types and their default bindings.


This is the default packaging type. It produces an archive in the JAR format. Its default bindings in the default ...

Get Maven Build Customization now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.