ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <>
Subject typedef onerror not squashing error for missing classpathref
Date Tue, 07 Nov 2006 19:33:42 GMT

I'm using Ant-1.6.5 and using a typedef to load up the Ant-Contrib tasks like

<typedef resource="net/sf/antcontrib/antlib.xml"

I run this in the case that one hasn't put ant-contrib.jar in
${user.home}/.ant/lib.  If the path reference "ant-contrib" is provided, it
will be typedef'd using a locally provided jar.  The problem is when the path
reference isn't defined.  I have onerror="report" and I expected that to
continue on without stopping the build when the path reference "ant-contrib"
doesn't exist.  But instead I get "Reference ant-contrib not found".  Why
doesn't onerror="report" take care of this?

Now, I realize I could write a condition to see if the reference exists, but
this typedefing is done within a macrodef, so I can't use the normal pattern of
an "unless" attribute on a target, at least not without leaking the
implementation of the macrodef out to the external target calling the macrodef.
 And, of course, I can't use ant-contrib's <if>/<then> functionality before the
typedef happens.

So, first, shouldn't onerror="report" or onerror="ignore" avoid the failure? 
And second, is there any solution other than leaking the internal
implementation of my macrodef to the targets using the macrodef?


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

View raw message