Let's say I have a pom file,
<version>14.4.1-SNAPSHOT</version>
which defines a version of the project to build. This value is updated automatically by our build system (jenkins).
Later on, in one of the plugins, I need to have a property, which incorporates the first two figures from the version, so that for 14.4.1-SNAPSHOT value, it would be "14.4", and for 13.12.39-SNAPSHOT value it would be "13.12".
Currently we update this value manually each month:
<plugins>
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>2.0.1</version>
<executions>
<execution>
<id>default-cli</id>
<phase>process-resources</phase>
<configuration>
<changeLogFile>src/main/resources/14.4/changeLog.xml</changeLogFile>
Ideally, I would love to have instead something like
<changeLogFile>src/main/resources/${releaseVersion}/changeLog.xml</changeLogFile>
But how would I get this ${releaseVersion}
(=14.4) calculated automatically from the <version>14.4.1-SNAPSHOT</version>
?
In that case it is absolutely automated, and we do not have any manual process in place.
Is there any expressions-kind-of-language I can use in pom files, which could parse the string 14.4.1-SNAPSHOT
and produce from it an 14.4
?