

Many Ant tasks delegate their work to external programs, either native or Java. This detail is not relevant to most end users, who just get the JAR they wanted, with the files they asked for. This Ant task has the same name as the common Java command-line utility, JAR, but is really a call to the Ant program's built-in JAR/ZIP file support. These perform a similar task to the command-line utilities of the same name.Īnother task used in this example is named jar: Therefore, the tasks used are mkdir and javac. For example, to build the compile target Ant must first create a directory called classes (which Ant will do only if it does not already exist) and then invoke the Java compiler. Within each target are the actions that Ant must take to build that target these are performed using built-in tasks. This tells Ant that before it can start the jar target it must first complete the compile target. The jar target lists the compile target as a dependency. It defines four targets - clean, clobber, compile and jar, each of which has an associated description. Example īelow is listed a sample build.xml file for a simple Java "Hello, world" application. NET Framework, EJB, and filesystem manipulations. Other task extensions exist for Perforce. Ī implements tasks and types for networking, Swing user interfaces, JSON processing and other. The WOProject extensions allow WebObjects developers to use ant in building their frameworks and apps, instead of using Apple's Xcode suite.Īntcontrib provides a collection of tasks such as conditional statements and operations on properties as well as other useful tasks. Once this is done, these task extensions can be invoked directly in the typical build.xml file. These extensions are installed by copying their. WOProject-Ant is just one of many examples of a task extension written for Ant.
APACHE ANT HOW TO CHANGE JAR NAME WITH COMMAND CODE
Gradle, which is similar software, was created in 2008, which in contrary uses groovy (and a few other languages) code instead of XML. In 2004 Apache created a new tool with a similar purpose called Maven. Because Ant made it trivial to integrate JUnit tests with the build process, Ant allowed developers to adopt test-driven development and extreme programming. For example, most open source Java developers included build.xml files with their distribution.

Īt one time (2002), Ant was the build tool used by most Java development projects.

Several proposals for an Ant version 2 have been made, such as AntEater by James Duncan Davidson, Myrmidon by Peter Donald Īnd Mutant by Conor MacNeill, none of which were able to find large acceptance with the developer community. Ant (version 1.1) was officially released as a stand-alone product on July 19, 2000. A proprietary version of Make was used to build it on the Solaris platform, but in the open-source world, there was no way of controlling which platform was used to build Tomcat so Ant was created as a simple platform-independent tool to build Tomcat from directives in an XML "build file".

Ant ("Another Neat Tool") was conceived by James Duncan Davidson while preparing Sun Microsystems's reference JSP and Servlet engine, later Apache Tomcat, for release as open-source.
