View on GitHub

PME @ Red Hat

Standardize Your Builds

Json Manipulation


PME offers the ability to modify one or many json files in the repository prior to running the build.


The manipulator is controlled by the jsonUpdate property. The format is

-DjsonUpdate=<file>:<json-xpath-expression>:[<replacement-value>] [,....]

Multiple comma separated values may be supplied. If the replacement-value is not specified the operation becomes a delete rather than an update.

The format for the xpath-style expression is specified in the JSON-Path project here.

Note: Any ‘,’ or ‘:’ in the path expression or replacement value should be escaped with ‘\’.

As an example:


This means:

  1. For the file manager/ui/war/npm-shrinkwrap.json
    • Use the path expression $..resolved to deep scan for resolved.
    • As there is no replacement, these are then deleted.
  2. For the file distro/data/src/main/resources/data/basic-settings.json
    • Use the path expression $..version to deep scan for version.
    • Replace the value with 1.3.1.rebuild-1