
Locate the file that you downloaded, which will be named something like apache-ant-1.6.2-bin.zip. I recommend that you download the binary distribution, at least to start with. Like all Apache downloads, it’s available in both binary (pre-compiled) and source code form. Obtain and Install AntĪnt can be downloaded from the Downloads page of the Apache Ant Website. Not bad, eh? Make no mistake: being able to write and maintain Ant build files is a very useful skill for any Java developer to possess. Phew! Ant can do all of that in response to a single command from you if you want it to. For example, it’s entirely feasible to use Ant to get the latest code from your source code repository, compile that code, run the unit tests and generate a report with the results, generate the Javadoc documentation, package the code into a J2EE application, deploy that application to an application server …and then send yourself an email when that’s all done. Ant is a veritable Swiss army knife of functionality. Its name is apt think of all the heavy loads a line of ants can carry on their backs. And because Ant is a Java program, it’s a cross-platform tool you can move your build files from one operating system to another unchanged, providing you haven’t used any platform-specific features.Īlthough Ant is a build tool, don’t think that it’s only good for compiling Java code. Many modern Java development environments also feature Ant support.Īnt uses build files, which are simply XML files that tell the Ant program what to do. It’s rapidly become the de-facto build tool for J2EE projects, so for developers, it’s certainly worth becoming familiar with the basics of Ant, at the very least. About AntĪnt is an open-source Java-based build tool from the Apache Software Foundation. What’s needed is Another Neat Tool in the developer’s armoury.

It’s no good to rely on some harangued colleague typing a complicated command in a Command Prompt window to invoke the Java compiler with a classpath as long as this article.

These are the reasons why Microsoft builds the five gigabytes of Windows source code every day, even though it takes twelve hours - on very powerful and expensive servers - to do so.Īs you might imagine, in order to be able to perform daily builds, the build process has to be automatic and repeatable. The daily build becomes the heartbeat of the project. If something’s broken, it gets noticed faster, so it gets fixed faster. If you build your software every day then it acts as a barometer, showing the state of the project. One of the principles of good software engineering is the daily build.
