This really sounds like something for maven filtering.
put your file somewhere in src/main/resources
then let the file contain for instance
(xml file)
<foo version="$version">
<bar/>
</foo>
add the following to your pom
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/foo.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<excludes>
<exclude>**/foo.xml</exclude>
</excludes>
</resource>
</resources>
</build>
Now maven will look for all string which matches $something (basically
anything that is accessable as a maven property) and filter your file
correctly.
This means that the modified file will be copied, and the file in the source
folder will be left alone..
Is it something like this you need?