ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <>
Subject Re: Problems with macrodef in Ant 1.6.2
Date Tue, 17 Aug 2004 16:45:28 GMT

can you provide a small build script that shows the problem.
I have just tried to reproduce the issue but could not.


Charles Hudak wrote:

>I just upgraded to Ant 1.6.2 from 1.6.1 to take advantage of the junit
>forkmode attribute. Now I am having problems with my macrodef's when I
>try to invoke multiple targets on the command line. For instance, if I
>invoke 'ant test dist' I get an error:
>C:\dev\common-util\build.xml:19: Element additional-properties  already
>However, if I run a single target, e.g. 'ant test' or 'ant dist',
>everything works fine.
>I have a common build.xml file that is used by my other projects for
>common build tasks and also allows extensions, via macros. The macro
>that is causing the build to fail (I'm sure others would do the same is
>this one:
><macrodef name=3D"set-properties">
>    <element name=3D"additional-properties" optional=3D"true"/>
>    <sequential>		=09
>        <property name=3D"" value=3D"${}" />
>        <property name=3D"" value=3D"${}" />
>        <!-- rest of properties omitted for brevity -->
>        <!-- Set additional properties -->
>	  <additional-properties/>
>    </sequential>
>I have a default task in the common build file that calls the macro:
>    Default set-properties target; simply calls the macro. Users can
>override to provide
>    additional properties by overriding this target and invoking the
>macro directly with the
>    additional properties to set.
><target name=3D"set-properties"=20
>	  description=3D"Sets the build environment properties">
>    <set-properties/>
>In my other build scripts, I would override the set-properties task and
>pass in additional properties to set by passing in additional properties
>under the <additional-properties> element.
>As I said, this configuration worked fine under 1.6.1 but is now failing
>under 1.6.2 and I have no idea why. It looks like perhaps that the task
>isn't being recycled correctly between build targets during the same
>build invocation (I had a similar problem with Xdoclet that was a bug in
>the Xdoclet task).
>If anyone has any ideas or solutions I would greatly appreciate it.
>Charles Hudak
>Principle Software Engineer, Cardionet Inc.
>To unsubscribe, e-mail:
>For additional commands, e-mail:

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

View raw message