How To Install buildnumber-maven-plugin on CentOS 7

In this tutorial we learn how to install buildnumber-maven-plugin on CentOS 7. buildnumber-maven-plugin is Build Number Maven Plugin

Introduction

In this tutorial we learn how to install buildnumber-maven-plugin on CentOS 7.

What is buildnumber-maven-plugin

This mojo is designed to get a unique build number for each time you build your project. So while your version may remain constant at 1.0-SNAPSHOT for many iterations until release, you will have a build number that can uniquely identify each build during that time. The build number is obtained from scm, and in particular, at this time, from svn. You can then place that build number in metadata, which can be accessed from your app, if desired. The mojo also has a couple of extra functions to ensure you get the proper build number. First, your local repository is checked to make sure it is up to date. Second, your local repository is automatically updated, so that you get the latest build number. Both these functions can be suppressed, if desired. Optionally, you can configure this mojo to produce a revision based on a timestamp, or on a sequence, without requiring any interaction with an SCM system. Note that currently, the only supported SCM is subversion.

We can use yum or dnf to install buildnumber-maven-plugin on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install buildnumber-maven-plugin.

Install buildnumber-maven-plugin on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install buildnumber-maven-plugin using yum by running the following command:

sudo yum -y install buildnumber-maven-plugin

Install buildnumber-maven-plugin on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install buildnumber-maven-plugin using dnf by running the following command:

sudo dnf -y install buildnumber-maven-plugin

How To Uninstall buildnumber-maven-plugin on CentOS 7

To uninstall only the buildnumber-maven-plugin package we can use the following command:

sudo dnf remove buildnumber-maven-plugin

References

Summary

In this tutorial we learn how to install buildnumber-maven-plugin on CentOS 7 using yum and dnf.