Maven plugins:
A maven plugin represents a set of goals which provides the facility to add your own actions to the build process.
Syntax to execute a plugin:
mvn [plugin-name]:[goal-name] |
Maven plugin types:
1. Build Plugins
2. Reporting Plugins
Build Plugins:
Build plugins are executed at the build time. Build plugins should be declared inside the element.
Reporting Plugins:
Reporting plugins are executed at site generation time. Reporting plugins should be declared inside the element.
Commonly used maven plugins:
Plugin | Description |
clean | It is used to clean up the target after build. |
compiler | It is used compile the java source files. |
deploy | It is used to deploy the artifact to the remote repository. |
failsafe | It is used to run the JUnit unit tests. |
install | It is used to install the built artifact into the local repository. |
resources | It is used to copy the resources to the output directory to include in the JAR. |
site | It is used to generate the site for the current project. |
surefire | It is used to run the JUnit unit tests. |