You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Charles Hudak <ch...@cardionet.com> on 2004/08/17 18:13:05 UTC

Problems with macrodef in Ant 1.6.2

Hi,

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:

BUILD FAILED
C:\dev\common-util\build.xml:19: Element additional-properties  already
present

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"app.name" value=3D"${ant.project.name}" />
        <property name=3D"project.name" value=3D"${ant.project.name}" />

        <!-- rest of properties omitted for brevity -->

        <!-- Set additional properties -->
	  <additional-properties/>
    </sequential>
</macrodef>

I have a default task in the common build file that calls the macro:

<!--=20
    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/>
</target>

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: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


CVS Task Fails To Execute

Posted by Nikola Banovic <nb...@americandatacompany.com>.
Hello,

When I try to access a CVS repository I get the following error:

[cvs] Caught exception: CreateProcess:
cvs -d:ext:me@anIP:/path/to/aRepository checkout -r r1_0_0 aModule error=2.

The unusual part of it is that the cvs.exe file is in the path (I can
checkout files if I copy and paste the command in the command prompt).

I'm running CVS client that comes with cvsnt 2.0.51 on Win2000. The CVS_RSH
system variable is set to a batch script (it is set to a full path of the
script file) that calls PuTTY's plink.exe (also full path) with appropriate
arguments. The following is content of the batch file:

@echo off
set CMD_LINE_ARGS=
:setArgs
if ""%1""=="""" goto doneSetArgs
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
shift
goto setArgs
:doneSetArgs
"C:\Program Files\PuTTY\plink.exe" -ssh -pw aPsswd %CMD_LINE_ARGS%

I'm using ant 1.6.2 (I also tried the version that comes with Eclipse
2.1.3).

I found a lot of posts on this topic, however none of them answered my
question.
Please let me know if you have a solution to this problem.

Thanks.

Nikola


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Problems with macrodef in Ant 1.6.2

Posted by Peter Reilly <pe...@apache.org>.
Hi,

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

Peter

Charles Hudak wrote:

>Hi,
>
>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:
>
>BUILD FAILED
>C:\dev\common-util\build.xml:19: Element additional-properties  already
>present
>
>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"app.name" value=3D"${ant.project.name}" />
>        <property name=3D"project.name" value=3D"${ant.project.name}" />
>
>        <!-- rest of properties omitted for brevity -->
>
>        <!-- Set additional properties -->
>	  <additional-properties/>
>    </sequential>
></macrodef>
>
>I have a default task in the common build file that calls the macro:
>
><!--=20
>    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/>
></target>
>
>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: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org