Recently I wanted to include the version of an artifact generated by a Maven build into a text file in that artifact. As Google and and good friends will help you with, I was pointed to [this article][1] that was exactly what I wanted.
Basically, create a /src/main/resources/version.txt file with the following content…
${project.version}
… then including the following snippet in your “build”…
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/version.txt</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<excludes>
<exclude>**/version.txt</exclude>
</excludes>
</resource>
</resources>
</build>[1]: https://stackoverflow.com/questions/3532135/using-maven-to-output-the-version-number-to-a-text-file