ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cole, Derek E" <>
Subject RE: Replacing build.xml with - Doing Ant builds directly from Java
Date Thu, 11 Jun 2009 15:41:30 GMT
You are correct that there is very little documentation on the subject, other than a few small,
simple examples on the net.  It seemed like one of the responders in that link you posted
was implying that he spoofed the tasks he needed to use? That seems like quite a bit more
work than would be necessary. When I have used ant from java, it was primarily to control
dependencies, but I still had underlying build.xml files that individual targets were called
from, using the java program to control when, handle errors, etc.


-----Original Message-----
From: Dean Schulze [] 
Sent: Thursday, June 11, 2009 11:28 AM
Subject: Replacing build.xml with - Doing Ant builds directly from Java

The Ant documentation has a section titled "Using Ant Tasks Outside
of Ant" which gives a teaser for how to use the Ant libraries from Java
code.  In theory it seems simple enough to replace build.xml with The Ant documentation hints at some undocumented
dependencies that I'll have to discover (undocumented from the point of
view of using Ant from within Java).
Using Java instead of xml to do an Ant build seems so obvious I wonder why there hasn't been
a parallel track over the years for as well as build.xml.
I asked this same question over at
The answers indicate that it isn't difficult to do, but that it is necessary to "spoof" the
project and target objects.
While it all looks encouraging I haven't seen any actual examples of how to deal with the
undocumented issues mentioned.  Has anyone documented how to do Ant builds from Java?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message