Understanding the purpose of Maven Plugin

By | October 27, 2020

In this post, We will talk and learn about Understanding the purpose of Maven Plugin

What is Maven Plugins?

  • Maven Plugin is one of the important features that is basically used to reuse the common build logic among different projects.
  • Plugins are used in many ways like compiling code, testing them with the Junits, creating jar/war/ear files and documentation of the projects.
  • Maven is nothing but a plugin execution framework in which every task is accomplished by the usage of plugins.

Below is the basic list of tasks that are handled by plugins in maven :

  • Creating jar/war/ear files.
  • Code compilation
  • Unit testing of the code.
  • Project documentation

Types of Maven Plugins

There are mainly two important types of plugins exist in maven:

  • Build Plugins – These plugins will execute during the build phase. These plugins are defined under the <build> element in pom.xml
  • Report Plugins – These types of plugins are executed during the site generation (report or javadocs generation) phase. These plugins We can configure under the <reporting> element in pom.xml
Plugin name Description
clean Used to delete the target directory in order to clean up the earlier build artifacts
compiler To compile java source files
surefile Executes the Junit tests and generate the reports.
jar Build the jar file of the project
war Build the war file of the project
javadoc Generates the javadocs of the project
antrun To run a set of ant tasks specified in any stage/phase of the build

That’s all about Understanding the purpose of Maven Plugin

You May Also Like:

What is Maven?
How to install and setup Maven Environment on windows?
Create a maven project using the command line
How to import the maven project in Eclipse?
How to Create a New Maven Project in Eclipse
How to create a maven web application project in Eclipse
How to create a multi-module project using maven?
How to Fix missing src/main/java & src/test/java folders in the Eclipse Maven web Project?
How to create user-defined properties in Maven?
What is the maven local repository location & how to change it?
How to add or update the maven settings.xml file in eclipse?
Importing maven remote Archetype Catalogs in eclipse ?
What is POM in the maven Project?
What is Super POM in Maven Project?
Compiling the Maven project with different JDK versions? 
Understanding of settings.xml in maven
How to enable a proxy setting in Maven?
Maven Dependency Scopes
How to generate javadoc in the maven Project
How to create a runnable JAR file with Maven?
How to add local jar files to a Maven project?
How to convert an existing Java Project to Maven in Eclipse?
How to exclude dependency in maven?
Managing External Dependencies in maven
Understanding of Maven Repositories
What is an archetype in Maven?
Snapshot Vs Version in maven
Apache Maven – Profiles

If you have any feedback or suggestion please feel free to drop in below comment box.

Leave a Reply

Your email address will not be published. Required fields are marked *