1. Overview

In this short tutorial, we’ll take a look at how to use variables defined inside Maven’s pom.xml from a Java application.

2. Plugin Configuration

Throughout this example, we’ll use the Maven Properties Plugin.

This plugin will bind to the generate-resources phase and create a file containing the variables defined in our pom.xml during compilation. We can then read that file at runtime to get the values.

#maven #java

Accessing Maven Properties in Java
9.70 GEEK