How can I replace the content of a file just before maven-war-plugin uses it to build a war?
the point is:
- in tomcat started within eclipse and mvn tomcat:run i want to use development configuration. it should be on the classpath (e.g. in resource folder). so the file should be there in all phases up to test, but not during package phase
- on bamboo, uat, prod server i want this configuration to be removed. it will be provided from classpath
- but i don’t want to remove the file. we use shared servers so anyone can put file with same name on classpath (by accident e.g. application.properties). so i want this file to be inside war (so spring will not look for it outside of war) but it should be empty.
- i don’t want to use profiles because i want to have same package working on all environments
so the question is: how can i replace file’s content during (or just before) building war
i found maven replacer plugin it easily allows change file content