ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Ivanov <>
Subject Re: Installer using Ant
Date Mon, 29 Mar 2004 07:48:18 GMT

Can you explain what exactly you want to install? I
have made some successfull attempts to use Ant as an
installer of web applications. I did roughly the
1) Install a database (MySQL in most cases)
2) Start it as a service(on Win), as a daemon (on
3) Using <sql> task, initialize the database of your
4) Install Tomcat (easy if you use a zip archive)
using unzip task abd start it as a service(on Win), as
a daemon (on Linux)
5) Copy the war of your web in tomcat's webapp dir and
wait to be deployed.

I usually control the folders where the pieces of
sofware will be installed by using properties file.
There is also an <input> task that can read user
input, but I have never used it.

As for platform independence (or how to reach the
unreachable :)) ), I have never succeded in it 100%.
Let's take as an example Tomcat. Under Linux it is
easy to unzip it somewhere, then prepare some sh file
and copy them in /etc/rc.d so that the tomcat is
started as a daemon. But I have never found a way how
to install it easy as a service under Windows. (I know
there is jakarta installer of tomcat that do this but
in this way I have to use different tomcat bundles - for linux and jakarta-tomcat.exe
for Windows). 
So my rule is: try hard to perform as many
installation steps from ant (which means platform
independence), for the rest steps do the manually or
write some platform dependent files say bat or sh.

Hope this helps
Ivan Ivanov

P.S. Well, I lied a little bit, since there is a
condition in ant called os, with which one can guess
the platform on which the installation is running.
After finding it one can invoke different targets. For

<condition property="isLinux">
    <os family="linux"/>

<condition property="isWindows">
    <os family="windows"/>

<target name="install" depends="lin-install,
    ...Do your common install steps here

<target name="win-install" if="isWindows">
    ...Do your windows specific install steps here

<target name="lin-install" if="isLinux">
    ...Do your linux specific install steps here
But is this platform independence we all looking for?

--- Pritesh saharey <> wrote:
> I would like to know can i create an installer for
> my java application using ant both for Windows and
> Linux.
> Pritesh Saharey
> BE(Mech)
> Software Engineer
> Join Community  --->
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message