Book Image

Maven Essentials

By : Russell E Gold, Prabath Siriwardena
5 (1)
Book Image

Maven Essentials

5 (1)
By: Russell E Gold, Prabath Siriwardena

Overview of this book

Maven is the #1 build tool used by developers and it has been around for more than a decade. Maven stands out among other build tools due to its extremely extensible architecture, which is built on of the concept of convention over configuration. It’s widely used by many open source Java projects under Apache Software Foundation, Sourceforge, Google Code, and more. Maven Essentials is a fast-paced guide to show you the key concepts in Maven and build automation. We get started by introducing you to Maven and exploring its core concepts and architecture. Next, you will learn about and write a Project Object Model (POM) while creating your own Maven project. You will also find out how to create custom archetypes and plugins to establish the most common goals in build automation. After this, you’ll get to know how to design the build to prevent any maintenance nightmares, with proper dependency management. We then explore Maven build lifecycles and Maven assemblies. Finally, you will discover how to apply the best practices when designing a build system to improve developer productivity.
Table of Contents (15 chapters)
Maven Essentials
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Preface
Index

Chapter 4. Maven Plugins

The roots of Maven go back to the Jakarta Turbine project, which was started as an attempt to simplify the build process of Jakarta Turbine. The beauty of Maven is its design. It does not try to do everything by itself, but rather delegates to a plugin framework. When you download Maven from its website, it's only the core framework, and the plugins are downloaded on demand. All the useful functionalities in the build process are developed as Maven plugins. You can also call Maven a plugin execution framework. The following figure shows the Maven plugins:

A Maven plugin can be executed on its own or can be executed as a part of a Maven lifecycle. We will discuss Maven lifecycles in Chapter 5, Build Lifecycles.

Note

A Maven build lifecycle consists of a set of well-defined phases. Each phase groups a set of goals defined by Maven plugins and the lifecycle defines the order of execution. Maven comes with three standard lifecycles: default, clean, and site. Each lifecycle...