Here is the relevant part of pom.xml
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.2</version>
<executions>
<execution>
<phase>pre-package</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<file>target/swagger/api.json</file>
<regex>false</regex>
<token>$BUILD_NUMBER$</token>
<value>${project.version}</value>
</configuration>
</plugin>
Here is api.json file
{
"apiVersion": "$BUILD_NUMBER$"
"developers": ["foo", "bar"]
}
After I run, mvn clean package, I do not see target/swagger/api.json being updated with project.version