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