O'Reilly logo

Maven Essentials by Prabath Siriwardena

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required