I have this ant task that creates a webstart jnlp file.
It replaces tokens like @title@ and such from a template file:
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="@codebase@">
<information>
<title>@title@</title>
</information>
<resources>
@jars@
</resources>
<application-desc main-class="@mainclass@"/>
</jnlp>
The problem is that I have many jars in my lib/ dir:
Log4J.jar, xpp.jar, resources.jar …
and 1 jars token.
How can I replace the @jars@ token with the jars file names?
so that the output becomes:
<resources>
<jar href="log4J.jar"/>
<jar href="xpp.jar"/>
<jar href="resources.jar"/>
</resources>
This is a part of my ant project:
<target name="webstart" description="Deploy as jnlp webstart">
<copy file="template.jnlp" tofile="test.jnlp">
<filterchain>
<replacetokens>
<token key="codebase" value="myCodebase" />
<token key="title" value="myTitle" />
<token key="jars" value="jar href="xxx.jar" />
</replacetokens>
</filterchain>
</copy>
</target>
<project/>
I managed to achieve this with ant-contrib (thanks to Chad Nouis for the hint with CDATA in properties):
Links: