Apache Maven plugins
Plugins are used to interact with a host application to provide a
specific task on demand. Maven provides a plugin execution framework and all work is done by
plugins i.e. real action is performed by plugins like compile code, create jar
files, create war files, unit test code, create project documentation etc. Clean
Plugin is one of the simplest maven 2.0 plugins. When we run "mvn
clean", the "clean" goal is executed and the target directory is
removed. Here, we are
providing a list of core and other plugins below:
Plugin |
Description |
Core plugins |
Corresponding to default core phases |
clean |
Clean up after the build. |
compiler |
Compiles Java sources. |
deploy |
Deploy the built artifact to the remote repository. |
install |
Install the built artifact into the local repository. |
resources |
Copy the resources to the output directory for including in the JAR. |
site |
Generate a site for the current project. |
surefire |
Run the Junit tests in an isolated classloader. |
verifier |
Verifies the existence of certain conditions. |
Packaging types / tools |
Related to packaging respective artifact types. |
ear 0 |
Generate an EAR from the current project. |
ejb |
Build an EJB from the current project. 1 |
jar |
Build a JAR from the current project. |
rar 2 |
Build a RAR from the current project. |
war |
Build a WAR from the current project. 3 |
Reporting |
Related to generating reports |
changelog 4 |
Generate a list of recent changes from your SCM. |
changes |
Generate a report from issue tracking or a change document. 5 |
checkstyle |
Generate a checkstyle report. |
clover 6 |
Generate a Clover report. |
doap |
Generate a DOAP file from a POM. 7 |
docck |
Documentation checker plugin. |
javadoc 8 |
Generate Javadoc for the project. |
jxr |
Generate a source cross reference. 9 |
pmd |
Generate a PMD report. |
project-info-reports 0 |
Generate a standard project reports. |
surefire-report |
Generate a report based on the results of unit tests. 1 |
Tools |
Tools available through Maven by default |
ant 2 |
Generate an Ant build file for the project. |
antrun |
Run a set of ant tasks from a phase of the build. 3 |
archetype |
Generate a skeleton project structure from an archetype. |
assembly 4 |
Build an assembly of sources and/or binaries. |
dependency |
Dependency manipulation and analysis. 5 |
enforcer |
Environmental constraint checking, User Custom Rule Execution. |
gpg 6 |
Create signatures for the artifacts and poms. |
help |
Get information about the working environment for the project. 7 |
invoker |
Run a set of Maven projects and verify the output |
one 8 |
A plugin for interacting with legacy Maven 1.x repositories and builds. |
patch |
Use the gnu patch tool to apply patch files to source code. 9 |
plugin |
Create a Maven plugin descriptor for any Mojo's found in the source tree, to include in the JAR. |
release 0 |
Release the current project |
remote-resources |
Copy remote resources to the output directory for inclusion in the artifact. 1 |
repository |
Plugin to help with repository-based tasks. |
scm 2 |
Generate a SCM for the current project. |
source |
Build a JAR of sources for use in IDEs and distribution to the repository. 3 |
IDEs |
Plugins that simplify integration with IDEs |
eclipse 4 |
Generate an Eclipse project file for the current project. |
idea |
Create/update an IDEA workspace for the current project. 5 |
Learn about Maven2 Eclipse Plug-in :