Archive for the ‘Why Ant?’ Category

Why Ant?

October 15, 2013 Leave a comment



Imagine that you are working on a large project. The project is a Java project and consists of many .java files. It consists of classes that are dependent on other classes and classes which are stubs or drivers, they are situated in multiple directories and the output files must go into multiple directories too. Suppose you have to perform obvious operations with the .java files as:-

  • Compile the .java files.
  • Put the .class files in a directory.
  • Put the .class files in a .jar.
  • Put all the html/jsp/css and other web files in one directory and package them in .war
  • Package all the third party libraries and dependancies into another .jar
  • Package all the .jars, .wars into .ears for deployment
  • Clean all the directories before every use so that you get fresh compiled versions or packaged structures.

Suppose you are coordinating all of this manually or using some other build utility which doesn’t do what you want it to (which is automate it exactly), then many hours are spent changing directories compiling individual files and so on. All these above operations fall under building and/or deploying a project. Now, imagine if there was a tool that could alleviate the stress and hassle you are experiencing and automate the complete process. Such a tool exists and its called ANT. Before Ant, building and deploying Java applications required a hodgepodge of platform-specific scripts, makefiles, proprietary IDEs, or manual processes. Now, nearly every open source Java project uses Ant. A great number of companies use Ant for internal projects as well.

Ant (originally an acronym for Another Neat Tool), is a java-based build tool with special support for the Java programming language but can be used for just about everything. In theory, it is kind of like make, without make‘s wrinkles. Ant automates software build processes. It is similar to Make but is implemented using the Java language, requires the Java platform, and is best suited to build Java projects.


Few of Ant’s features:

  • Ant is platform-independent and hence Cross-platform.
  • It is written purely in Java.
  • Ant is particularly good at automating complicated repetitive tasks and thus is well suited for automating standardised build processes.
  • Ant accepts instructions in the form of XML documents thus is extensible and easy to maintain.
  • More popular than ‘make’ for building Java projects
  • Updated and improved regularly
  • Straightforward XML syntax
  • Plug-in oriented architecture encourages expansion
  • Directly supported by some IDEs (with more coming)
  • Free and open source Read more…
Categories: Why Ant? Tags: , , , ,