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 following sections list out a set of commonly used Maven plugins and their usages.
The clean plugin
As discussed earlier, 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. In Chapter 2, Understanding the Project Object Model (POM), we 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...