Read the "Plugin" definition in the glossary.
Maven plugins implement the functionality. For example, the "java" plugin does java operations such as the "compile" goal.
Plugins are installed in the local Maven repository along with the other non-plugin dependencies.
For plugin reference information, refer to the Plugins page.
Maven 1 has two types of plugins: bundled and non-bundled. See below for details on these plugin types.
Note that in Maven 2, all plugins are non-bundled.
Bundled plugins are those that come with the Maven distribution. Users need no additional actions to use them. Refer to the Plugins List.
Non-bundled plugins are those that do not come with the Maven distribution. This is how Maven is expandable with new functionality - anyone can create a Maven plugin. Since these plugins do not ship with Maven, the user must install them into the local Maven repository.
There are three ways to make a Maven plugin visible to your project:
This is typically the preferred method. The benefits of this approach are:
<dependency> <groupId>maven-plugins</groupId> <artifactId>maven-findbugs-plugin</artifactId> <version>1.3</version> <type>plugin</type> </dependency>
Note that this method does not install the plugin into Maven's plugin directory, which means that the plugin will only be usable by the project declaring it as dependency. In order to permanently install a plugin and make it visible to all your projects, you should use one of the following methods.
maven plugin:download -DgroupId=maven-plugins -DartifactId=maven-findbugs-plugin -Dversion=1.3
Refer to the non-bundled plugins in the list on the Plugins page.
Read the "Goal" definition in the glossary.
Ant users run custom created "targets", Maven users run goals. Usually, one runs pre-defined Maven goals (the bundled or non-bundled plugins have the goals), but sometimes users create their own goals in either a new plugin or in the maven.xml file.
For example,
maven java:compile
compiles the Java source.
Note that you can run multiple goals one after the other in the same invocation of Maven. For example,
maven faq xdoc
runs the faq plugin followed by the xdoc plugin.
Note that some plugin goals cause other plugin goals to run first. For example, running
maven jar
causes these goals to run in this order:
Refer to the Getting Started and Using Maven pages for more info.
The project.xml file is the "POM" - project object model. It contains the configuration information for the project.
Refer to the Project Descriptor on the Reference page for its info.
Refer to th Project Inheritence section in Customising Maven for more info.
Properties for the project are set in this file. When a plugin lists customization properties, this is the file to put them in.
When extending from another POM, this file is inherited too.
In addition to plugin properties, the Maven core itself has many properties.
Refer to the Properties Reference on the Reference page and the Extending the Build with Properties section in Customising Maven for more info.
Note, it is recommended to limit use of this file. The maven.xml file can contain processing customization. This includes complete custom goals and adding to the lifecycle of another plugin.
Refer to the Scripting section, Customising Maven and Maven Jelly Tag Libraries for more info.
One of the best ways to understand maven.xml is to look at ones in existing Maven projects, including those in Maven source.
Note that Maven 2 does not have this file. Instead, the plugins and the POM has all processing and configuration.