Member-only story

Maven | How to write you own plugin

Egor Voronianskii
3 min readFeb 2, 2024
Meme with Chuck Norris about pom.xml without snapshot depependencies

In this article, I will show you how you can write your plugin. Recently, I made an error that caused a slight delay in release. The cause of the error was my poor attention to pom.xml. The developer who created the pull request has kept dependencies from the snapshot to the release version. As most software engineers love to automate, I started thinking about how I could prevent this type of error.

What is Maven plugin?

First, let’s start defining what the Maven plugin is.
The plugin performs additional actions on your project, such as collecting git info — git maven plugin and checking that code style is formatted according to check style — CheckStyle plugin.

The example of the usage of plugins looks like the one below.

 <build>
<plugins>
<plugin>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.3.1</version>
<configuration>
<configLocation>checkstyle.xml</configLocation>
<consoleOutput>true</consoleOutput>…

--

--

Egor Voronianskii
Egor Voronianskii

Written by Egor Voronianskii

I am a Software Engineer, JVM enthusiast, cat - lover, part-time surfer.

Responses (1)