EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 600+ Courses All in One Bundle
  • Login
Home Software Development Software Development Tutorials Maven Tutorial What is Maven Plugins?
Secondary Sidebar
Maven Tutorial
  • Maven Basic and advance
    • What is Maven
    • How to Install Maven
    • Maven Commands
    • Maven GroupId
    • Maven WAR Plugin
    • Maven Build Command
    • Maven Failsafe Plugin
    • Maven Profile
    • IntelliJ Maven
    • Maven Enforcer Plugin
    • Maven Javadoc Plugin
    • Maven WAR Plugin
    • Maven Build Command
    • Maven GroupId
    • Maven Force Update
    • Maven Encrypt Password
    • Maven Environment Variables
    • AssertJ Maven
    • Maven Run Single Test
    • Maven kafka-clients
    • Maven Quickstart Archetype
    • Maven Install Dependencies
    • Maven XMLBeans
    • Maven Local Repository
    • Maven Versions
    • Maven Jar Plugin
    • Maven Assembly Plugin
    • Maven exec plugin
    • Maven Central Repository
    • Maven Surefire
    • Maven Deploy
    • Maven Phases
    • Maven Archetype
    • Maven Skip Test
    • Maven Dependency Scope
    • Maven Shade Plugin
    • Maven Repository Spring
    • Maven Eclipse Plugin
    • Maven Exclude Dependency
    • Maven Life Cycle
    • Maven Repository
    • Maven POM File
    • Maven Plugins
    • What is Maven Plugins
    • Maven Interview Questions
    • Maven Flags
    • Maven Project
    • Maven Settings.XML

What is Maven Plugins?

By Priya PedamkarPriya Pedamkar

What is Maven Plugins?

What is Maven Plugins?

In this topic, we are going to learn about What is Maven Plugins and the different aspects of a project lifecycle like reporting, documentation, and so on could be managed by a comprehensive tool known as Apache Maven which works on a primary source of information.

The need to standardize a project in order to ensure clarity in its definition, development and sharing of the resources led to the emergence of Maven. The advent of Apache Maven has undoubtedly simplified and made life easier for the Java Developers.

Build under the Apache license, Maven repository consists of various libraries. It also makes sure any sort of conflicts pertaining to getting the right JAR files is avoided as it has all the required dependencies such as Hibernate, spring, etc. in its repository.

All in One Software Development Bundle(600+ Courses, 50+ projects)
Python TutorialC SharpJavaJavaScript
C Plus PlusSoftware TestingSQLKali Linux
Price
View Courses
600+ Online Courses | 50+ projects | 3000+ Hours | Verifiable Certificates | Lifetime Access
4.6 (86,328 ratings)

In Apace Maven, the pom.xml file is the most important file where the required dependencies for a project such as Hibernate need to be mentioned. Next is the ArtifactId or the GroupId which ensures each project in the Maven is unique. The package used for the project is described by the combination of ArtifactId with the GroupId.

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

The build tool is the first subset in the Maven where the artifacts are deployed in the server and enable the automation and the integration of the build tools. Next is the task of managing the resources, plugins, and the dependencies in a project which is done by the Dependency Management. The scope of dependency should be known beforehand to avoid any conflict in the use of the dependency for a particular instance. The Project Management is the third subset of the Apache Maven consisting of the pom.xml file. Proper documentation of the code and information about various aspects like missing tasks, versions, etc. could be maintained in this phase. The consistency is maintained across different projects in Maven as every project maintains a standardized directory.

So far, we have learned about Maven and its functionalities in brief. Next, we would look into the plugins of Apache Maven in detail.

Maven Plugins

As seen earlier, Maven provides a standardized way to maintain each project by proving all the necessary JAR files, and dependencies in its repository and separates one project from another via a unique id.

Now, all the work in Apache Maven is done by the plugins and hence is often called a plugin execution framework. The Plugins are divided into:-

  • Build Plugins – During the build, the build plugins are executed, and needs to be configured in the <build/> element present in the pom.xml file.
  • Reporting Plugins – The pom.xml file has the <reporting/> element tag in which the reporting plugins needs to be configured. During the site generation stage, the reporting plugins are executed, and hence the plugins are localized, as well as internationalized.

Localization is a process of adapting to a different language during the site generation stage by translating a few downloaded property files and translating the texts in those files.

The Apache Maven plugins are up to date and are maintained in the org/apache/maven/plugins/ subfolder. The organization of the package follows a standard directory structure resembling the naming convention of the Java package.

Below are some of the core plugins in Apache Maven which are mostly used in the phases like clean, compile, etc.

  • clean – Once the build is completed, these plugins cleans it up.
  • compiler – The Java source file is compiled by the compiler plugin.
  • deploy – The built artifact is deployed to a remote repository via the deploy plugin.
  • failsafe – In an isolated classloader, the failsafe plugin is used to run the JUnit integration.
  • install – The built artifact is installed into the local repository with the help of this plugin.
  • resources – The inclusion of the JAR is done by copying the resources to the output directory with this plugin.
  • site – The generation of the site for a project is done with the site plugin.
  • verifier – To verify certain conditions, and to ensure integration tests, the verifier plugin is useful.

There are also some plugins which are involved in Packaging.

  • ear – The current project generates an EAR via the ear plugin.
  • ejb – The current project builds an EJB via the ejb plugin.
  • jar – The current project builds a JAR via the jar plugin.
  • rar – The current project builds a RAR via the rar plugin.
  • war- The current project builds a WAR via the war plugin.
  • shade – The current project builds an Uber-JAR via the war plugin
  • jlink – The Java run-time image is built by this plugin.
  • jmod – The Java JMod files are built by this plugin.

Apart from the build, and the Packaging plugins, there are also the reporting plugins.

  • changelog – A project could have multiple recent changes which are generated by the changelog plugin from the SCM.
  • changes – For report generation from the change document.
  • doap – A project description is important to ensure clarity of the work. The doap plugin allows its generation from the pom.xml file.
  • docck – To check all the documentation, the docck plugin is used.
  • javadoc – The java documentation for a project is done via the Javadoc plugin.
  • jxr – The cross-reference of the source is generated with the jxr plugin.
  • linkcheck – The project documentation has the Linkcheck report generated with this plugin.
  • pmd – The PMD report is generated by the pmd plugin.
  • project-info-reports – The project reports in a standard format is generated with this.

There are several default miscellaneous tools present as well in Maven.

  • ant – The project’s ant build file is generated with the Ant plugin.
  • archetype – The project structure in a skeleton format generated from the archetype.
  • dependency – The dependencies are manipulated and analyzed with the dependency plugin.
  • patch – The patch files are applied to the source code with gnu patch tool
  • release – The pom.xml file is updated, and the SCM is tagged after the project is released.
  • pdf – The project’s documentation could be transformed into a pdf version with this plugin.
  • scm-publish – The website built in Maven is published to an scm location with this plugin.
  • stage – To ensure the staging, and promotion after a release.

Conclusion

Apache Maven has many different kinds of plugins which are updated time, and again to ensure ease of the tasks in hand. The official website has a rich-list of all the plugins and their GitHub links.

Recommended Articles

This has been a guide to What is Maven Plugins. Here we discussed the basic concepts of Maven Plugins and list of a few common plugins and their functionalities. You can also go through our other suggested articles to learn more –

  1. What is Apache Flink?
  2. What is Design Pattern in Java?
  3. Maven Plugins
  4. Maven Life Cycle
Popular Course in this category
All in One Software Development Bundle (600+ Courses, 50+ projects)
  600+ Online Courses |  3000+ Hours |  Verifiable Certificates |  Lifetime Access
4.6
Price

View Course
0 Shares
Share
Tweet
Share
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Java Tutorials
  • Python Tutorials
  • All Tutorials
Certification Courses
  • All Courses
  • Software Development Course - All in One Bundle
  • Become a Python Developer
  • Java Course
  • Become a Selenium Automation Tester
  • Become an IoT Developer
  • ASP.NET Course
  • VB.NET Course
  • PHP Course

ISO 10004:2018 & ISO 9001:2015 Certified

© 2022 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Software Development Course

C# Programming, Conditional Constructs, Loops, Arrays, OOPS Concept

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more