Odo.lv » Recipes » Ant building tool

Ant building tool

lv 

Ant can be installed via command
apt-get install ant
If this does not install the version we need, it is possible to install manually from the tarball installation file.

  1. Download the newest Ant binary distribution from their homepage http://ant.apache.org; pick the ".tar.gz" file. At the time of the writing it is apache-ant-1.7.0-bin.tar.gz
  2. Unzip this installation, and copy the directory "apache-ant-1.7.0" to /usr/share:
    su - root
    cd /home/student/downloads
    tar xzf apache-ant-1.7.0-bin.tar.gz
    mv apache-ant-1.7.0 /usr/share/
    rm apache-ant-1.7.0-bin.tar
  3. Find out, if the symlink "ant" points to anything:
    which ant     
    # assume, it gives the reply "/usr/bin/ant"
    ant -version       
    # if this is the newest, e.g. 1.7, then stop here
    ls -al /usr/bin/ant      
    # list symlink's target
    rm /usr/bin/ant          
    # delete the symlink
    ln -s /usr/share/apache-ant-1.7.0/bin/ant /usr/bin/ant   
    # define a new value for it
    If you discover no symlink, then run just the last line.
  4. Find out the Ant's version now:
    ant -version
    The version should switch to (at least) 1.7.0.

Ant custom tasks

You may need to configure Ant further in order to use custom tasks.

  1. In order to use FTP task (see http://ant.apache.org/manual/install.html):
    1. Get Jakarta ORO package from http://jakarta.apache.org/oro/
    2. Get Commons NET package from http://commons.apache.org/downloads/index.html
    3. Copy JAR files found in these packages to "/usr/share/apache-ant-1.7.0/lib" (it is convenient to use Midnight Commander (mc) to extract needed JARs from larger packages and copy them).

Created by Valdis Vītoliņš on 2008/08/09 19:11
Last modified by Valdis Vītoliņš on 2011/04/07 19:55

XWiki Enterprise 2.7.33656 - Documentation
Creative Commons Attribution 3.0 Unported License