Reputation: 1725
I'm looking for some way to replace patterns in files with values, during build time.
E.g. a configuration file may look the same except that different machines requires different hostnames in some setting. In that case i want to have a template file, where hostname is replaced with @@hostname@@ Then when building, I want to create separate versions of the file with the patter replaced with the correct value for each environment.
In ant you could use "replace", is there something similar in maven2? I know that I can run ant form maven, but if theres a maven plugin doing it, I'd prefer that one.
I found http://code.google.com/p/maven-replacer-plugin/ but it's very new...
Suggestions?
Thanks!
Upvotes: 1
Views: 2787
Reputation:
keep up with the maven-replacer-plugin, the project is still alive and well
Upvotes: 3
Reputation: 6832
The resource plugin is what does filtering in Maven. IIRC it supports the ant syntax as well as the ${foo} maven syntax.
Upvotes: 4