Step by Step Guide to Developing a Custom Maven Plugin

Maven is a plugin execution framework where plugins do the heavy-lifting in the build process. This article demonstrates how to create a custom maven plugin and use it in a maven project

Somnath Musib
The Startup

--

Photo: Unsplash by Clint Patterson

Overview

Maven at its core is a plugin execution framework. Its plugins let users do all the tasks that need to be done in a maven project. Maven provides a set of core plugins to execute the frequently occurring task. For example, compiling the java files, packaging project artifacts or generate Javadocs for the project.

However, the list of core plugins provided by the maven is limited and heavily focused on the common need of the community. Most often, developers need to perform custom tasks that are specific to the project and there is no readily available plugin. To compensate for this limitation, Maven empowers the developer community with tools to develop custom plugins as per the need and let include it in the build process.

This article demonstrates the fundamental concepts of building a custom maven plugin with the utilities provided by maven. As part of this, we will develop a lightweight Maven plugin to convert an XML document to a JSON document.

--

--

Somnath Musib
The Startup

Software Developer, Cloud Architect | Author "Spring Boot In Practice" . Find more at https://musibs.github.io