Date: Fri, 29 Mar 2024 10:20:12 +0000 (UTC) Message-ID: <287118213.63.1711707612843@73aad50967bf> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_62_1949401927.1711707612843" ------=_Part_62_1949401927.1711707612843 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
IzPack can be easily integrated inside an Ant build process.
You need to have the following prerequisites installed on your local sys= tem:
<=
;webdir>
attribute must be specified in the input file. Used=
to force creation of a standard installer when the <webdir&g=
t;
attribute has been used.inheritAll: (optional, boolean). If t= rue all properties defined in the ant build process are transmitt= ed to izpack parser for substitution.
default
|
gz
=
|
bzip2
|
xz
|
l=
zma
|
defl=
ate
Defau=
lt: default (uncompressed)
Since: IzPack 5.1 (has been broken in 5.0)
Nested elements:
<config><=
/code>
<property>=
;
<propertyset=
>
Here is how the Ant build file may look like:
<?xml= version=3D"1.0" encoding=3D"UTF-8"?> <project name=3D"izpack" default=3D"compile"> =20 <property name=3D"izpack-dist" value=3D"${user.home}/IzPack"/> <property name=3D"izpack-installer" value=3D"setup.jar"/> =20 <path id=3D"lib.path"> <fileset dir=3D"${izpack-dist}/lib" includes=3D"*.jar"/> </path> =20 <taskdef name=3D"izpack" classname=3D"com.izforge.izpack.ant.IzPackTask" classpathref=3D"lib.path" /> =20 <target name=3D"compile"> <echo message=3D"Makes the installer using IzPack to ${izpack-instal= ler}"/> <izpack input=3D"${basedir}/src/main/resources/install.xml" output=3D"${basedir}/${izpack-installer}" =20 installerType=3D"standard" =20 basedir=3D"${basedir}/src/main/resources" izPackDir=3D"${izpack-dist}"/> <echo message=3D"${izpack-installer} created"/> </target> =20 </project>
The above assumes that the IzPack distribution has been installed to
You can find a fully compilable example here:
Using the above example:
cd test
ant
It builds an executable installer setup.jar in the working directory.
Instead of using the 'input' attribute to specify an external installati= on document, you can embed the installation config as a child of the IzPack= task using a config child element with a CDATA section.
<prop= erty name=3D"jboss.home.url" value=3D"http://www.jboss.com/" /> ... =20 <!-- Call IzPack with an embedded install using the config element -->= ; <izpack output=3D"${dist.dir}/IzPack-install.jar" installerType=3D"standard" basedir=3D"${dist.dir}" inheritAll=3D"true" izPackDir=3D"${dist.dir}/"> <config><![CDATA[ <installation version=3D"1.0"> <info> <appname>JBossAS</appname> <appversion>4.0.2</appversion> <appsubpath>jboss-4.0.2</appsubpath> <authors> <author name=3D"JBoss Inc." email=3D"sales@jboss.com"/> </authors> <url>@{jboss.home.url}</url> <javaversion>1.4</javaversion> </info> ... ]]></config> </izpack>
Property references of the form
@{x}
|
are replaced by the associated x ant property if it is defined.