Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate XML File with Maven

I have an XML file that looks like this...

<foo>
   <bar>$VALUE$</bar>
</foo>

Is there anyway I can merge this xml file and a .properties file using Maven or is this a task best left to Ant?

like image 616
Shane Courtrille Avatar asked Mar 26 '26 07:03

Shane Courtrille


1 Answers

The resource plugin can copy with filtering, replacing a placeholder ($VALUE$ in this case) with a property value. Here's the relevant doc: http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html

It should be noted that maven placeholders look like this: ${VALUE}.

like image 159
sblundy Avatar answered Mar 27 '26 20:03

sblundy