Stranzenbach, Ralf | 14 Apr 10:50 2015

Acessing ANTs execution graph


i have a fairly complex build system that recently introduces some additional compexity. To describe my
problem, i'll sketch a very simplified Ant build:


    <target name="clean" depends="-clean" />

    <extension-point name="-clean" />

    <target name="init" depends="-init" />

    <extension-point name="-init" />

    <target name="compile" depends="-compile" />

    <extension-point name="-compile" depends="-init" />

    <target name="install" depends="-install" />

    <extension-point name="-install" depends="-compile" />

    <target name="recompile" depends="-recompile" />

    <extension-point name="-recompile" depends="-clean, -compile" />


This basic structure of the ANT file is required, because all extension-points are extended by specific
(Continue reading)

Joseph Kesselman/Watson/IBM | 27 Mar 14:26 2015

Wishlist item: Resource macros

Macrodef very explicitly says that the macro invocation is treated as a 

Unfortunately, I need macros to simplify gathering resources, so macrodef 
doesn't help me.

So I'm requesting <resource-macrodef> and <resource-macro> -- just working 
names, I'm sure something better exists -- which are isomorphic with 
Macrodef but have invocations that are typed as Resource Collections. 
Syntax could be almost identical, but use <union> in place of <sequential> 
as the body element.

Or, perhaps better, just modify macrodef so it recognizes when its body is 
a union rather than a squential and changes its type (and the type of its 
invocation) appropriately.

(Personally, I really wish that you'd left macros as pure syntactic 
operations rather than constraining them to be tasks in the first place... 
but since that decision was made, I think you need to "drop the other 
shoe" and give us the resources equivalent.)

"Everything should be as simple as possible. But not simpler." -- 
attributed to Albert Einstein
Al Le | 24 Mar 23:31 2015

Pass build failure message to the calling script


I call Ant (execute a build) from a .bat script (under Windows). If the build fails, I'd like not only to
detect that it failed (this is possible via ERRORLEVEL) but also get the failure message (at least its
first line if the message contains multiple lines).

Is it possible without parsing the output of Ant? If yes, how?

Thank you!

How do I create a customized build?

First let me preface this question by stating that I'm very much an Ant 

I have a Java application that was designed to provide the ability to "plug 
 in" a message transport mechanism (e.g. ActiveMQ) for a given client 
installation.  The code defines interfaces for the transport and then there 
are a number of implementations that conform to the interfaces, providing 
concrete implementations of the transports we support.  The idea is that a 
given client will indicate the transport they want/need to use and we will 
provide them with a build that includes only the classes for the chosen 
implementation. No other transport implementations should be included.  The 
reasons for this are to keep code size down and for 3rd party licensing 

How do you set up an Ant build file to customize the jar file produced so that 
it only includes a subset of the transport implementations?  Obviously I need 
to somehow get the transport selection into the build file so that it has the 
info it needs.  From what I've read, you have to use properties to get input 
arguments into the script.  Beyond that, I am at a loss as to what to do next.

I'll provide a brief package hierarchy to illustrate what is located where. 
If it makes sense to restructure this in some way, please let me know.

<base package>.impl
	config	<- Used to unmarshal a file used to configure the 
		impl				<- Where the supported transport implementations live
(Continue reading)

Josh Hoff | 17 Mar 01:14 2015

Excluding classpath jars from %ANT_HOME%\lib?

Hello Ants!

I'm having an issue where the server (that I don't have control over)
will have two junit jars in %ANT_HOME%\lib, and I'll pull one down (that
I do want) with ivy. My tests are failing because of the two in
%ANT_HOME%\lib conflicting with the one I got from ivy, but I can't find
where (if anywhere) %ANT_HOME%\lib is added to the classpath.
jason mazzotta | 22 Feb 17:24 2015

mail task results in authentication failure when using gmail as smtp server

To whom it may concern,
        I am trying to use gmail as an smtp server with the ant mail task.
I have set up the task as follows:


         user="e-mail address"





         subject="Nightly unit test results">

         <to address="e-mail address" />

         <from address="e-mail address" />

         <message src="/Directory/On/My/Machine" />


This worked a few months ago, but these days, when I run my ant build file
I get the follow error:

Failed to send email: 534-5.7.14 <
(Continue reading)

Jeffrey Walton | 17 Feb 21:11 2015

Specify source file language in build.xml?

I'm trying to build an Android project from the command line. I'm
getting an error during `ant release`. The error is unmappable
character for encoding UTF-8.

The sources appear to be written by a non-English speaker, and the
offending characters are in comments like so:

     * Projet   : Permission Explorer
     * Auteur   : Carlo Criniti
     * Date     : 2011.06.10
     * Classe ApplicationDetail
     * ActivitÈ d'affichage du dÈtail d'une application
     * avec les permissions qu'elle utilise

There are multiple errors like this. If /usr/local/bin/ant release
2>&1 | grep -i error | wc -l is accurate, then there's 103 of them.

I've been through ant's documentation at "Writing a Simple Buildfile"
( and "Property Task"
(, but damn if I can
figure out how to set a source file language to get past these errors.

How do I specify a source file language in build.xml?
Jackie Xiao | 13 Feb 02:54 2015

RE: [Ant]Read buid.xml file in memory

Hi, Martin

The thing is, we need to enable customers to work with us, but we don’t want to share the build scripts (I
know it’s weird).

So, we want to encrypt the build.xml and give them the encrypted file.

In the build process, we will decrypt build.xml in memory, and if Ant can read the content from memory, this
should work.

Best Regards

From: Martin Gainty <mgainty <at><mailto:mgainty <at>>>
Date: 2015年2月12日 GMT+08003时52分04秒
To: Ant Users List <user <at><mailto:user <at>>>
Subject: RE: [Ant]Read buid.xml file in memory
Reply-To: "Ant Users List" <user <at><mailto:user <at>>>
Hi Xiao-

supposedly yes ...if you can get your File to extend apache jackrabbit MemoryFile

I would not rely on any java implementor to guarantee your Java Object will be "in memory" vs "on disk"
specifically a java object which implements Serializable will save the object to disk by the serializer..

(except your objects declared as transient of course)

Did you have a specific requirement in mind for "Memory File" for your build.xml ?

(Continue reading)

Jackie Xiao | 11 Feb 17:07 2015

[Ant]Read buid.xml file in memory

Dear List:

Is it possible for Ant to read build files from memory?

If possible, what will be the necessary steps, thanks.
This e-mail and any attachments thereto are intended for the sole use of the recipient(s) named above and
may contain confidential and/or privileged material. Any use of the information contained herein
(including, but not limited to, total or partial reproduction, communication, or dissemination in any
form) by persons other than the intended recipient(s) is prohibited. If you received this in error,
please contact the sender immediately and delete the material from any computer.
Eric Fetzer | 10 Feb 22:36 2015


I'm running Ant 1.7 and having an issue I don't understand.  I see sshexec finish with a successful status,
then it gets back to the calling task and bombs out.  I upped the timeout value and that seemed to work once,
but not after that even though it's WAY over the value that the ssh command is taking.  Here's the ssh task,
and then the build output:
        <sshexec host="myMachine"
          command="/bin/bash -l ant -f /my/folder/BuildMyApp.xml"
  [sshexec] main:
  [sshexec]   [sshexec]   [sshexec] BUILD SUCCESSFUL  [sshexec] Total time: 1 minute 7 seconds
  [sshexec] Feb 10, 2015 1:25:02 PM org.apache.bsf.BSFManager exec
SEVERE: Exception : org.apache.bsf.BSFException: JavaScript Error:
Internal Error: The following error occurred while executing this line:
c:\BuildDeployScripts\build.xml:338: Remote command failed with exit status -1
 at org.apache.bsf.BSFManager.exec(
 at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(
 at java.lang.reflect.Method.invoke(
(Continue reading)

Jason Ricles | 5 Feb 15:54 2015

conditional flatten mapping

I have the following flatten mapping in my ant file.

      <path id="build.classpath" path="${deplibs}"/>
      <pathconvert property="mf.classpath" refid="build.classpath" pathsep=" ">

However for a couple of the paths in the deplibs variable I want to
make these full instead of relative paths. Is there anyway to do a
conditional in the pathconvet in ant to say make these flat but do not
flatten these paths?