Cari di Apache Ant 
    Apache Ant Manual & Tutorial
Daftar Isi
 Loggers & Listeners (Berikutnya)

Apache Ant User Manual
Daftar Isi


Introduction

Apache Ant is a Java-based build tool. In theory, it is kind of likemake, without make's wrinkles.

Why?

Why another build tool when there is alreadymake,gnumake,nmake,jam,andothers? Because all those tools have limitations that Ant's original authorcouldn't live with when developing software across multiple platforms.Make-liketools are inherently shell-based: they evaluate a set of dependencies,then execute commands not unlike what you would issue on a shell.This means that youcan easily extend these tools by using or writing any program for the OS thatyou are working on; however, this also means that you limit yourself to the OS,or at least the OS type, such as Unix, that you are working on.

Makefiles are inherently evil as well. Anybody who has worked on them for anytime has run into the dreaded tab problem. "Is my command not executingbecause I have a space in front of my tab?!!" said the original author ofAnt way too many times. Tools like Jam took care of this to a great degree, butstill have yet another format to use and remember.

Ant is different. Instead of a model where it is extended with shell-basedcommands, Ant is extended using Java classes. Instead of writing shell commands,the configuration files are XML-based, calling out a target tree where varioustasks get executed. Each task is run by an object that implements a particularTask interface.

Granted, this removes some of the expressive power that is inherent in beingable to construct a shell command such as`find . -name foo -exec rm {}`, but itgives you the ability to be cross-platform--to work anywhere andeverywhere. Andhey, if you really need to execute a shell command, Ant has an<exec> task thatallows different commands to be executed based on the OS it is executingon.


Installing Apache Ant


Using Apache Ant


Running Apache Ant


Apache Ant Tasks

Tasks


Concepts and Types

Concepts

List of Types

Namespace

Antlib

Custom Components


Developing with Apache Ant


Tutorials

Hello World with Apache Ant
A step by step tutorial for starting java programming with Ant.

Writing Tasks
A step by step tutorial for writing tasks.

Tasks using Properties, Filesets & Paths
How to get and set properties and how to use nested filesets and paths while writing tasks. Finally it explains how to contribute tasks to Ant.


Apache Ant API

Apache Ant Core

Core Tasks

Core Types

Optional Tasks

PackageDescription
org.apache.tools.ant.taskdefs.optional 
org.apache.tools.ant.taskdefs.optional.ccm 
org.apache.tools.ant.taskdefs.optional.clearcase 
org.apache.tools.ant.taskdefs.optional.depend 
org.apache.tools.ant.taskdefs.optional.depend.constantpool 
org.apache.tools.ant.taskdefs.optional.ejb 
org.apache.tools.ant.taskdefs.optional.extension 
org.apache.tools.ant.taskdefs.optional.extension.resolvers 
org.apache.tools.ant.taskdefs.optional.i18n 
org.apache.tools.ant.taskdefs.optional.image 
org.apache.tools.ant.taskdefs.optional.j2ee 
org.apache.tools.ant.taskdefs.optional.javacc 
org.apache.tools.ant.taskdefs.optional.javah 
org.apache.tools.ant.taskdefs.optional.jdepend 
org.apache.tools.ant.taskdefs.optional.jlink 
org.apache.tools.ant.taskdefs.optional.jsp 
org.apache.tools.ant.taskdefs.optional.jsp.compilers 
org.apache.tools.ant.taskdefs.optional.junit 
org.apache.tools.ant.taskdefs.optional.native2ascii 
org.apache.tools.ant.taskdefs.optional.net 
org.apache.tools.ant.taskdefs.optional.perforce
ANT Tasks for Perforce integration.
org.apache.tools.ant.taskdefs.optional.pvcs 
org.apache.tools.ant.taskdefs.optional.script 
org.apache.tools.ant.taskdefs.optional.sos
Ant tasks for working with a SourceOffSite source control system.
org.apache.tools.ant.taskdefs.optional.sound 
org.apache.tools.ant.taskdefs.optional.splash 
org.apache.tools.ant.taskdefs.optional.ssh 
org.apache.tools.ant.taskdefs.optional.testing 
org.apache.tools.ant.taskdefs.optional.unix 
org.apache.tools.ant.taskdefs.optional.vss 
org.apache.tools.ant.taskdefs.optional.windows 

Optional Types

Ant Utilities

Other Packages


Feedback and Troubleshooting

If things do not work, especially simple things like ant -version, then something is wrong with your configuration. Before filing bug reports and emailing all the Apache Ant mailing lists

  1. Check your environment variables. Are ANT_HOME and JAVA_HOME correct? If they have quotes or trailing slashes, remove them.
  2. Unset CLASSPATH; if that is wrong things go horribly wrong. Ant does not need the CLASSPATH variable defined to anything to work.
  3. Make sure there are no versions of crimson.jar or other XML parsers in JRE/ext
  4. Is your path correct? is Ant on it? What about JDK/bin? have you tested this? If you are using Jikes, is it on the path? A createProcess error (especially with ID=2 on windows) usually means executable not found on the path.
  5. Which version of ant are you running? Other applications distribute a copy -it may be being picked up by accident.
  6. If a task is failing to run is optional.jar in ANT_HOME/lib? Are there any libraries which it depends on missing?
  7. If a task doesn't do what you expect, run ant -verbose or ant -debug to see what is happening

If you can't fix your problem, start with the Ant User Mailing List . These are other ant users who will help you learn to use ant. If they cannot fix it then someone may suggest filing a bug report, which will escalate the issue. Remember of course, that support, like all open source development tasks, is voluntary. If you haven't invested time in helping yourself by following the steps above, it is unlikely that anyone will invest the time in helping you.

Also, if you don't understand something, the Ant User Mailing List is the place to ask questions. Not the developer list, nor the individuals whose names appears in the source and documentation. If they answered all such emails, nobody would have any time to improve ant.

To provide feedback on this software, please subscribe to the Ant User Mailing List

If you want to contribute to Ant or stay current with the latestdevelopment, join theAnt Development Mailing List

A searchable archive can be found at http://marc.theaimsgroup.com.Other archives will be documented online at Mailing Lists Archives


Editor/IDE Integration

All the modern Java IDEs support Apache Ant almost out of the box.

  • AntRunner For JBuilder (unbundled)
  • AntWork Plugin for the Jext Java Text Editor (unbundled)
  • JDEE (Java Development Environment for Emacs) has built-in text ANT integration: selection of target through text field, execution, hyperlink to compilation errors. Installation: built-in JDEE 2.2.8 or later. Configuration: through customize menu "Jde Build Function"
  • IDEA has built-in GUI ANT integration: GUI selection of targets, execution, hyperlink to compilation errors
  • NetBeans NetBeans IDE uses Ant as the basis for its project system starting with the 4.0 release.
  • jEdit jEdit is an open source java IDE with some great plugins for Java dev, a good XML editor and the Antfarm plugin to execute targets in a build file.
  • Eclipse Eclipse is IBM's counterpoint to NetBeans; an open source IDE with Java and Ant support.
  • Virtual Ant GUI allows you to work on a Virtual File System without dealing with the XML. Plugs into Eclipse, Netbeans & Intellij.
  • WebSphere Studio Application Developer
  • JBuilder 9 Personal (pdf) JBuilder supports Ant with the following features. Add Ant nodes to projects and execute Ant targets from within JBuilder. Add custom Ant-based build tasks with custom Ant libraries to run Ant from within JBuilder. Rapid navigation from Ant build error messages to source files. Customize build menu and toolbar with custom build targets.

Authors

Apache Ant User Manual by
 Loggers & Listeners (Berikutnya)