Questions tagged [ant]

Apache Ant (formerly Jakarta Ant) is a declarative, XML-based build tool for Java projects. It provides a rich set of standard tasks for performing most common build operations, such as compilation with javac, building archives and running tests. Ant's functionality can be extended through custom tasks and macros.

Ant

Apache Ant is a Java open-source library and command-line tool whose mission is to drive processes described in XML build files as targets and extension points dependent upon each other. The main known usage of Ant is the build of Java applications.

Ant supplies a number of built-in tasks allowing to compile, assemble, test and run applications. Although primarily aimed at building Java applications, Ant can also be used effectively to build non-Java software, for instance C or C++ applications. More generally, Ant can be used to pilot any type of process which can be described in terms of targets, tasks, and macros. It's a standard and effective framework which transforms a development structure of project to deployment structure.

Ant was historically meant as a replacement and Java counterpart for the UNIX Make build utility.

References

Extensions

Example

Hello World

A build.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<project name="HelloWorld" default="world" basedir=".">
  <target name="world" depends="message" description="outputs a friendly message">
    <echo message="World!" />
  </target>
  <target name="message">
    <echo message="Hello, " />
  </target>
</project>

This project can be run from the directory containing the build.xml file by just typing:

  • ant
  • or ant -f build.xml

The list of available self-documenting targets can be viewed with ant -p.

21 questions
87
votes
6 answers

How do I install ant on OS X Mavericks?

After upgrading to OS X 10.9 Mavericks, ant is no longer on my path. [126] 11:23:26 rkarl-mba-4:~/mobile-baselayer > ant zsh: permission denied: ant [126] 11:23:50 rkarl-mba-4:~/mobile-baselayer > which ant ant not found I tried installing through…
11
votes
3 answers

How to install ant & ivy?

I've installed ant... and I've installed ivy (both from synaptic), but ant can't find ivy! When I run ant to build 'october-chess-engine' I get the following: BUILD FAILED /home/zeigfreid/repos/october-chess-engine/build.xml:32: Problem: failed to…
Ziggy
  • 906
5
votes
1 answer

ant support for ssh-agent

I have an existing build.properties file that uses scp like this: The…
3
votes
2 answers

How to get Apache Ant to recognize Ivy

I'm trying to install Apache Ivy, but I can't get ant to recognize it. Per Apache Ivy installation instructions, I downloaded Ivy from osuosl.org Ivy archives, unpacked it, and copied the .jar file to where ant should be able to see it. However, any…
Steve
  • 151
1
vote
1 answer

ant not working on my ubuntu, command: ant -version

Following command ant -version is throwing error Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-6-openjdk-amd64/lib/tools.jar screen shot: du@ubuntu-pc:~/workspace/alfresco/HEAD/root/projects$ ant -version Unable to locate…
Dan
  • 11
1
vote
0 answers

Ant error after installing NetBeans 7.3 in Lubuntu

I have NetBeans 7.01 from Debian repository - all works. I have problem with NetBeans 7.3 from official site (installed at the same machine) - I can't compile anything: ERROR - Ant is misconfigured and cannot be run. …
Vitaly Zdanevich
  • 211
  • 1
  • 4
  • 19
1
vote
1 answer

Concatenating many files into one

I currently have this command: copy /b *.txt newfile.txt But I want to include all files with folders as well. How can I do this? Is it possible to add this to Apache Ant as well? I also consider doing this to minify JS files. Is there anyway to…
1
vote
1 answer

How to install ant 1.8 on Ubuntu 11.04 properly

I have attempted to install ant 1.8 on a Ubuntu 11.04 box using these instructions: http://www.thegeekwork.com/how-to-install-ant-1-8-2-using-ppa-on-ubuntu/ And when I list what it has installed, I get the following: $ dpkg -L…
bguiz
  • 2,141
1
vote
2 answers

ANT_HOME doesn't match up with ant -version

I started out by trying to run ant on a java program in a RH terminal. BUILD FAILED /home/phuong3/soar/soarRepos2/soar/tools/trunk/build.xml:187: Compiler Adapter 'javac1.6' can't be found. Total time: 0 seconds I was told that this problem would…
1
vote
0 answers

installing incubating netbeans10 using apache ant

While installing build ant - netbeans from incubating-netbeans 10.0 source I see this screen. I have added Java path and installed ant. C:\Netbeans10>ant Buildfile:…
mrunalg
  • 11
1
vote
0 answers

Can Apache Ant fully run a task over a fileset without stopping on the first failure?

I have a target set up in ant which runs a PHP lint check on all modified files since the last check.
Sean
  • 121
0
votes
1 answer

sed regex pattern matched greedy although it should not

I stumbled upon a behaviour I can not explain, hope some of you guys can help me out. I try to generate a sort of documentation from a bigger Ant project, as such I use sed to filter the information from the files, that i need in the documentation…
0
votes
2 answers

Accidentally deleted PATH in Windows 8

So last week I was trying to install Ant, and accidentally deleted my environmental variable Path. I dont really know what I am doing. What effect will this have/what can I do to fix it?
Cazs
  • 1
0
votes
1 answer

ant command to start a new terminal and execute command on mac

I am trying to open a new terminal window in mac and execute a node command via ant
Nav
  • 101
0
votes
1 answer

Sublime Text with SuperAnt path is not correct

Since upgrading to the latest Mac OSX (10.9.1) I cannot run builds in Sublime Text using the SuperAnt tool. Here is the error: <> are my privacy omissions [Errno 2] No such file or directory: 'ant' [cmd: ['ant', '-f',…
DocWatson
  • 111
  • 6
1
2