Inside the installation XML the access to Ant properties per
@{ant.property.name}
will only work, if you insert the whole XML content as CDATA into the build.xml
<IzPack output="${dist.dir}/IzPack-install.jar" installerType="standard" basedir="${dist.dir}" IzPackDir="${dist.dir}/"> <config><![CDATA[ <installation version="1.0"> <info> <appname>@{my.app.name.defined.in.build.xml}</appname> ... </info> ... ]]></config> </IzPack>
If you use different files, the properties are unknown within the IzPack file. But there is a simple solution: Copy the install.xml into a temporary file and expand the properties during this step.
<target name="installer" depends="jar" description="compiles the IzPack installer"> <copy overwrite="yes" verbose="yes" file="${dir.install}/izpack/install-definition.xml" tofile="${java.io.tmpdir}/install-definition.xml"> <filterchain> <expandproperties /> </filterchain> </copy> <IzPack input="${java.io.tmpdir}/install-definition.xml" output="${dir.dest}/${app.name}-install.jar" installerType="standard" basedir="${basedir}" /> </target>
So you can use ${app.name}
inside the install.xml (don’t use @{app.name}
). But you shouldn’t use Ant properties, which are redefined by IzPack itself or in a <variable>
tag section. These properties are expanded before Ant calls IzPack and could contain the wrong values.