I'm creating web-app with Java+Spring+FreeMarker, and, I want to write app version directly into FreeMarker template. I try using maven replacer plugin, but, when I create war package, file with replaced string (in target directory) becomes overriden with file with origin token. Here is quote from pom.xml:
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.3</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<includes>
<include>${basedir}\src\main\webapp\templates\include\version.ftl
</include>
</includes>
<outputFile>${basedir}\target\${project.build.finalName}\templates\include\version.ftl
</outputFile>
<replacements>
<replacement>
<token>version</token>
<value>${project.build.finalName}</value>
</replacement>
</replacements>
</configuration>
</plugin>
What I'm doing wrong?
I've found solution. Need to use prepare-package phase in war plugin: