maven-replacer-plugin and multiple files
This seems to be a bug in the latest 1.5.2 Version.
As soon as I change the version on bugfix level down to 1.5.1, the Not Working Example works just as expected and all tokens are replaced by their values.
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.1</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<includes>
<include>${project.build.directory}/myApp/index.jsp</include>
</includes>
<replacements>
<replacement>
<token>%PROJECT_VERSION%</token>
<value>${project.version}</value>
</replacement>
</replacements>
</configuration>
</plugin>
I also removed the ignoreMissingFile as suggested by ben.
The includes
tag works with version 1.5.2 as well, you just have to specify the basedir
tag before includes
, and put the filepath (excluding the filename) as the basedir
value and just the filename as the include
tag value. So in your case something like this should work:
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.2</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<basedir>${project.build.directory}/myApp</basedir>
<includes>
<include>index.jsp</include>
</includes>
<replacements>
<replacement>
<token>%PROJECT_VERSION%</token>
<value>${project.version}</value>
</replacement>
</replacements>
</configuration>
</plugin>