O'Reilly logo

Maven Build Customization by Giacomo Veneri, Riccardo Giomi, Umberto Antonio Cicero, Roberto Baldi, Lorenzo Anardu

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

maven-plugin-plugin

After the Mojo has been compiled and packaged into a JAR, Maven can invoke it as a plugin. The main difference between a common JAR and a plugin JAR lies in a file named plugin.xml, stored inside the JAR's directory, META-INF/maven/plugin.xml.

In a plugin's JAR artifact, this file is the plugin descriptor. It contains all the information that Maven needs to recognize a JAR as a plugin's JAR artifact:

  • The list of Mojo classes
  • The list of plugin's configurations
  • The list of dependencies and requirements needed

Manually writing all the information can be a long and error-prone task. Fortunately, Maven provides a plugin for doing this dirty work. The maven-plugin-plugin provides the descriptor goal to generate the plugin descriptor ...

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