Plugin discovery and execution
To associate a plugin with your Maven project, you have to either define it explicitly in your application POM file, or you should inherit it from a parent POM or the super POM file. Let's take a look at the Maven jar
plugin. The jar
plugin is defined by the super POM file, and all the Maven projects inherit it. To define a plugin (which is not inherited from the POM hierarchy), or associate a plugin with your Maven project, you must add the plugin configuration under the build/plugins/plugin
element of your application pom.xml
. In this way, you can associate any number of plugins with your project, as shown here:
<project> ... <build> <plugins> <plugin> <artifactId>maven-jar-plugin</artifactId> <version>2.4</version> <executions> <execution> <id>default-jar</id> <phase>package</phase...