Overview
PME offers the ability to modify one or many xml files in the repository prior to running the build.
Warning : This should not be used to modify XML POM files within the Maven Model (as they will get overwriten by the POM Manipulator) but for e.g. assembly files. |
Configuration
The manipulator is controlled by the xmlUpdate
property. The format is
-DxmlUpdate=<file>:<xml-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 as used in XPath and in the specification here.
Note: Any ‘,’ or ‘:’ in the path expression or replacement value should be escaped with ‘\’.
As an example:
-DxmlUpdate='src/main/assembly/dep.xml://include[starts-with(.,'org.apache.tomcat')]:com.rebuild:servlet-api"'
This means:
- For the file src/main/assembly/dep.xml
- Use the path expression //include[starts-with(.,’org.apache.tomcat’)] to locate the appropriate node.
- Replace the value with com.rebuild:servlet-api.