Properties Maven Plugin

The Properties Maven Plugin is here to make life a little easier when dealing with properties. It provides goals to read and write properties from and to files, and also to set system properties.

It's main use-case is loading properties from files instead of declaring them in pom.xml, something that comes in handy when dealing with different environments.

If you have a properties file called teams.properties with this content:

  toronto=raptors
  miami=heat

and invoke the properties:read-project-properties goal, it would be the same as declaring the following in your pom.xml:

  <properties>
    <toronto>raptors</toronto>
    <miami>heat</miami>
  </properties>

The properties loaded from files can be used to filter resources differently for different environments. Those using Spring's PropertyPlaceholderConfigurer can see how these goals can be useful.

Goals Overview

Usage

Instructions on how to use the Properties Maven Plugin can be found here.