I have one requirement where I want to read all the parameterized properties
from one file and replace it in other file.
parameterized.properties is having below two properties.
INSTALL_DIR = /application/config
Now I have other property file project.properties with below two properties.
After I replace strings from "parameterized.properties" to
"project.properties" project.properties should have following value.
I saw maven replace plugin is not sufficient for this ?
I can use ANT to perform this task but I donot want to use ANT inside MAVEN.
Any one has better approach for this.
Why not? This is perfectly acceptable to most pragmatic users of Maven...
Can't see why it should't. Can you explain?
Replace plugin should be fine. Properties plugin also.
Hello! I'm sorry you've gotten such short answers. I'll see if I can be of
Property replacement is already available in Maven in two places:
- As part of the resources mechanism in the POM (details here:
- Programmatically, as part of the maven-resources-plugin's copyResources
goal (details here:
Besides those, you can of course use the maven-replacer-plugin (though I
don't really see it being any better than just straight resource filtering
for the problem you've described), or do properties replacement in Ant
(though that seems overkill, as you suggest).
Let's start there and see if either of those two approaches helps you out.
If not, we'll need more details about your project layout.
Thanks for your valuable help. This can be achived with out ANT.
My goal is to migrate my project from ANT to MAVEN and donot want to use ANT
for this Proof of concept.
Given below are steps. Hope it will help some one.
1) Load all the properties in initialize phase using POM properties plugin.
2) Use POM's resource plugin with copy resource goal (process resource is
having some issue not sure)
during Validate phase.
This will replace all the tokens from local/global.properties file to