I'm working with a specific environment in which the version of a maven dependency is kept on a file.
e.g.
$ cat version_of_dependency
1.2.3
What I wanted to do is make the project pom.xml
automatically read the file and fill the dependency, everytime its build lifecycle is triggered (for example, a simple mvn clean install
).
Ideally, I wanted something like:
<dependency>
<groupId>my_dependency_gid</groupId>
<artifactId>my_dependency_artifact</artifactId>
<version>$(cat version_of_dependency)</version>
</dependency>
Is there a way to do something like this? One option would be to have a properties file, but I wanted to keep the format of the version file untouched. Also, we wanted to avoid running a shell script before compiling.
Thanks!