<!-- CI/CD friendliness: allow changing the value of the 'revision' property within the file from cli.
Usage:
# Maven, any version (we bind the 'antrun:run' goal to the 'validate' phase)
mvn validate -DnewRevision=4.17.0
# Maven 3.3.1+
mvn antrun:run@set-revision -DnewRevision=4.17.0
-->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>set-revision</id>
<phase>validate</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="set-revision" if="newRevision"
description="Replaces, in pom.xml, the value of the 'revision' property">
<replaceregexp file="${project.basedir}/pom.xml" flags="g"
match="<revision>[^<]*</revision>"
replace="<revision>${newRevision}</revision>"/>
<echo>Project revision set from ${revision} to ${newRevision}.</echo>
</target>
</configuration>
</execution>
</executions>
</plugin>