Java Ant

Written by Larry Gray on . Posted in Ant

Java Ant

While DOS and Unix shell scripting can automate developer task, in the Java world there is a problem with this. Both DOS and Unix shell scripts are system dependent solutions. A single developer one day decided to sit down and write Ant and it was an immediate success. Ant is a system independent solution. Ant uses XML files called build files or build.xml to describe task to be performed by Ant. Below I list some common task that ant can perform for you. To run the script you simply go to the folder with the build.xml file and run the command 'ant'. Ant will then report if it was a successful build or not.

  • compile sources
  • delete folders and files
  • move folders and files
  • archive files in jar and war files
  • build javadocs (java documentation)
  • upload files using ftp or scp to servers(for deployment)
  • run commands on the local development machine
  • run commands on remote servers
I'm sure that there is much more that ant can do for you. And you can make up custom task at will. I will update this article as I use ant and learn more.


I must at least mention Maven. Maven is another project management and building tool that works in conjunction with Ant. Maven manages the building and production of multiple projects.