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

Common Maven plugins


Maven plugins are mostly developed under the Apache Maven project itself as well as under the Codehaus and Google Code projects. The next sections list out a set of commonly used Maven plugins and their usage.

The clean plugin

As discussed before, the clean plugin executes the clean goal of the Maven clean plugin to remove any of the working directories and other resources created during the build, as follows:

$ mvn clean:clean

The Maven clean plugin is also associated with the clean lifecycle. If you just execute mvn clean, the clean goal of the clean plugin will get executed.

You do not need to explicitly define the Maven clean plugin in your project POM file. Your project inherits it from the Maven super POM file. Chapter 2, Demystifying Project Object Model, discussed the Maven super POM file in detail. The following configuration in the super POM file associates the Maven clean plugin with all the Maven projects:

<plugin>
  <artifactId>maven-clean-plugin...