foolhunger | 27 Aug 18:31 2014

Ant - Pathelement with wildcard only works in Javac forked mode?

I encountered below issue when using Ant.

My ANT script snippets:

<path id="id.compile.classpath">
  <pathelement location="src/compile_lib1/*" />
  <pathelement location="src/compile_lib2/*" /></path>
<javac srcdir="${module.root}/${src.root}" destdir="${}"
  nowarn="${javac.nowarn}" debug="${javac.debug}" fork="${javac.fork}"
  <include name="**/*.java"/></javac>

When set fork=”true” in javac task, the wildcard pathelement works fine,
but when forked is set to false, Ant seems failed to interpret wildcard
correctly. (compilation failed, due to classpath error).

Any suggestions


<Stay Hungry, Stay Foolish>
Best Regards
Al Le | 31 Jul 11:10 2014

How to override a property that was set in the command line via "-D..."

user <at>

How to override a property that was set in the command line via "-D..."


Could someone please help me with the following situation?

I have some ant scripts that are used in two ways:

1. Standalone build, i.e. the script is executed directly from the command line
2. As a part of a larger build -- then the script is called via 'ant' from another
    script (here we have a main and a called scripts).

Each script uses a property 'outFileName' that specifies where to write some output to.
Both the main and the called script use this property. The script gets the value of
the property passed from the caller.

The root script (i.e. the one called from the command line) gets passed the value of
'outFileName' via the "-DoutFileName=..." option.

When the main script calls a called script, it may specify another value for the
property 'outFileName' (using the nested 'property' element). The called script
should notice no difference how it was called (i.e. whether it is called from the
command line or as a called script from another script).

Now the propblem: It turns out that the properties specified via "-D=..." are set
as *user* properties. Hence it's not possible to redefine them via the nested
elements. Ant not even using a script task with a call 'project.setProperty()'.

(Continue reading)

Eric Fetzer | 17 Jul 18:47 2014

StarTeam Upgrade

We're upgrading our StarTeam version from 2009 to 14.2 and somewhere between 2009 and 14, there was a
complete rewrite in the SDK.  I'm wondering if my StarTeam tasks will work once I get on the other side of
the upgrade?  Any help?

Lee, Sarek | 2 Jul 00:04 2014

StarTeam Label Trouble with Ant

     I'm new to Ant and am working on it for StarTeam build automation. I've scoured the internet for a similar
problem but I was unable to find any, and everyone at my work believe it should run fine.

My goal is to apply a build label (named "buildLabelPIPAppCVS") to a  directory ("AdvancedAttr")  and all
its subfolders/files on our StarTeam server. This is executed as one of the steps in the build, and needs to
draw information from variables defined earlier in the build (like "buildLabelPIPAppCVS").

Below is the code snippet  I am running:


                <echo message=""/>
                                <echo message="2S. Apply Build Label in StarTeam"/>
                                                <format property="nowstamp" pattern="yyyyMMddHHmmss" locale="en"/>
                                <stlabel URL=""
           label= "${buildLabelPIPAppCVS}"
           description="-This description is currently unavailable.-"


However,  when I run the above snippet, the build fails and I receive the error message shown below:

(Continue reading)

coder | 13 Jun 22:59 2014


Hi all,

I'm in the process of writing an ANT task and would like to use
BuildTestRule in my testing as recommended by the manual
(  However,
the class doesn't seem to be in either the core ant.jar or test-utils.jar. 

I've downloaded apache-ant-1.9.4-src and see the class in
src/tests/junit/org/apache/tools/ant/ but it's not clear to me which
target I need to run in order to create a jar that will include the
compiled class.  I've tried the default target and "test-jar" but the
BuildTestRule is missing from the resultant jars of both builds. 

Can anyone advise on how or where I can obtain a jar containing the
compiled BuildTestRule, please?


Ps. The link provided in the manual to a nightly build appears to be
Stefan Bodewig | 13 Jun 09:36 2014

ApacheCon CFP closes June 25

[forwarding a message by the team that organizes ApacheCons]

Dear Ant/Ivy/EasyAnt enthusiast,

As you may be aware, ApacheCon will be held this year in Budapest, on
November 17-23. (See for more info.)

The Call For Papers for that conference is still open, but will be
closing soon. We need you talk proposals, to represent Ant/Ivy/EasyAnt at
ApacheCon. We need all kinds of talks - deep technical talks, hands-on
tutorials, introductions for beginners, or case studies about the
awesome stuff you're doing with Ant/Ivy/EasyAnt.

Please consider submitting a proposal, at

KARR, DAVID | 30 May 01:11 2014

How to gracefully not use a feature if the task jar isn't present?

I'm trying to implement an optional feature in a build script that utilizes the "xmltask" jar. To be less
intrusive, I want the feature to be silently disabled if the xmltask jar isn't available.  I initially
assumed that I would check for the presence of the jar in "$HOME/.ant/lib", but that has a few problems.  I
can get this to work, but I realized that "$HOME" doesn't work for Windows, and "$USERPROFILE" doesn't
work for non-windows.  In addition, someone could conceivably install the jar in $ANT_HOME/lib or
somewhere else.

I'm already using "if:set" on a property that I set if the jar is available, but I'd like that check to be a
little more robust.  I don't see a good way to do that.
Markus Wiesenbacher | 19 May 11:42 2014

Cannot find symbol (CertAndKeyGen) with JDK8


I am trying to compile my classes (which make use of CertAndKeyGen) but I am
always getting "cannot find symbol". If I add the JRE-lib folder into my build-script it works. I don´t
know why, as the JDK-lib folder also contains the rt.jar containing the needed classes.

With JDK7 it always worked without that. I am using Ant v1.9.4. Any suggestions?

Thanks and best regards
Tom Cleghorn | 16 May 16:13 2014

http condition in 1.9.x

Is there an easy method of capturing the exact response when using the 
"http" condition? Given a task like this:

<fail message="HTTP error code returned">
      <http url="fakehost"/>
</fail>'d be nice, in a project I'm working on at the moment, to be able to 
return more granular error messages than "boo, HTTP error!" and "yay, no 
HTTP error!", but it seems as if the actual response code is only visible 
with -d output.

Stefan Bodewig | 14 May 17:45 2014

[ANN] Apache AntUnit 1.3 Released

The Apache AntUnit Ant Library provides a test framework for Ant tasks
and types.

AntUnit 1.3 adds new assertions that deal with non-file resources better
than the existing ones of 1.2 and provides additional access to the log
created during tests.

Source and binary distributions are available from the Apache Ant
download site:


Please verify signatures using the KEYS file available at the above
location when downloading the release.

For complete information on the AntUnit, including instructions on how
to submit bug reports, patches, or suggestions for improvement, see the
Apache AntUnit website:

Stefan Bodewig, on behalf of the Apache Ant community
Roger Whitcomb | 14 May 02:49 2014

Question about Copy task with empty PatternSet

Hi all,
   I was banging my head against the wall for several hours today on this problem and came up with a tolerable
solution. But I thought I would ask to see if others might have a better solution. 
   The situation is: we have a product that can be built to support several different feature sets. There are
properties set (or not) depending on which features to support. Now a new feature requires some new .jar
files which are not needed by any other feature. I have a PatternSet with these .jar files listed:
<PatternSet id="other-jars">
   <include name="abc*.jar" if=""/>

Now there is a Copy task that is putting stuff in the installation directory that looks like this:
<Copy todir="install/lib">
   <FileSet dir="lib">
      <PatternSet refid="other-jars"/>

(I'm not doing a copy/paste here, just from memory, so be easy if there are syntax errors--hopefully you get
the drift.)

Now the problem is: if "" is not defined, the PatternSet is empty and the FileSet thinks it
should copy everything in the source directory to the target. But what I want is to copy nothing. 

So, any thoughts / suggestions as to how to achieve what I want?

~Roger Whitcomb

P.S. Using Ant 1.9.3 if that makes a difference. 
(Continue reading)