I'm confused by your statement "I don't want to do that on the disk. (We don't want to save the changes.)". Can you elaborate on that. You can use the <copy/>
task with <filterset>
and that will allow you to process your HTML files and replace whatever tokens you want to replace in them.
Then you can use the copied versions of the files that have the replaced tokens in your war. I tried using <filterset>
in the war itself, but it doesn't work with <fileset>
or <classes>
. You have to use <copy>
to use <filterset>
, and that's how I've always done it.
What do you mean save the changes? You don't have to save the copied files, they're work files just like everything else.
<copy dir="${html.dir}"
todir="${html.work.dir}">
<filterset>
<filter token="${token1}" value="${value1}"/>
<filter token="${token2}" value="${value2}"/>
<filterset>
</copy>
<war destfile="${war.file}"
webxml="${web.xml.file}">
<classes dir="${html.work.dir}"/> <!-- The munged HTML files -->