POM utils Maven plugin

A Maven plugin for modifying POM files

This Maven plugin allows DevOps teams to alter some project aspects using a standard Maven execution.

This plugin is specially useful for project refactoring and for legacy projects that need environment variables or other adjustements during the building phase. You can add the plugin execution to the build pipeline with a standar Maven run.

Introduction

I’ve dealed with some project architectures that packed environment properties (like service end points, credentials/tokens, etc.) inside the application binaries, even disabling (removing) testing servlets and debugging classes on packaging time.

Our solution was to build the application for each environment with the appropiate variables added after the project checkout (some variables where unknown or restricted for the developer team, so they where managed by the release team in a configuration database, and then added with a similar plugin).

Source code

The plugin is a Maven Mojo written in Java, and use the Maven’s internal project model.

Current goals

Currently, this plugin contains goals for project’s these POM modifications:

  • Adding and deleting dependencies
  • Adding or modifying properties (individually by command line or with a properties file)
  • Modifying the project information (ArfifactID, GroupID, etc.)