Hi,

> -----Original Message-----
> From: Butt, Vaughn A. [mailto:[EMAIL PROTECTED]]
> Sent: 22 April 2002 05:17
> To: 'Cactus Users List'
> Subject: Fault report (and fix) for Cactus Sample : <fail> task
doesn't
> support the "unless" attribute
> 
> C:\java\jakarta-cactuC:\java\jakarta-cactuC:\java\jakarta-
> cactuC:\java\jakar
> ta-cactu
> 
> I am using ant-1.4.1. and jakarta-cactus-13-1.3 (which may be
> jakarta-cactus-23-1.3)
> 

No, it is correctly named. The 13 represent J2EE API 1.3 (see
http://jakarta.apache.org/cactus/downloads.html for more details).

> When I try to "ant clean", ant complains with the following message;
> 
> C:\java\jakarta-cactus-13-1.3\sample-servlet\build\build.xml:155: The
> <fail>
>  task doesn't support the "unless" attribute.
> 
> The check.properties target has the following task;
> 
> <fail message="Missing property or property pointing to an invalid
file
> (check your build.properties file)"
>      unless="properties.ok"/>
> 
> After looking at the documentation for ant-1.4.1 I determined that
this is
> a
> fault
> in the build-share.xml file.
> 
> Is this a real problem or am I misconfigured or is it something else?
> 

argh! Yes, the unless attribute has only been added to Ant 1.5. The
other option is to use the prepackaged Ant that is available on Cactus
web site.

> Anyway, I think I have fixed it with the following change.  Feel free
to
> comment (constructively;-) on my ant style.
> 
> Replace this;
> 
>     <target name="check.properties" depends="display.properties">
> 
>         <condition property="properties.ok">
>             <and>
>                 <available file="${cactus.framework.jar}"/>
>                 <available file="${cactus.ant.jar}"/>
>                 <available file="${servlet.jar}"/>
>                 <available file="${aspectjrt.jar}"/>
>                 <available file="${commons.httpclient.jar}"/>
>                 <available file="${httpunit.jar}"/>
>                 <available file="${junit.jar}"/>
>            </and>
>         </condition>
> 
>         <fail message="Missing property or property pointing to an
invalid
> file (check your build.properties file)"
>             unless="properties.ok"/>
> 
>     </target>
> 
> with this;
> 
>     <target name="set.properties.ok" depends="display.properties">
> 
>         <condition property="properties.ok">
>             <and>
>                 <available file="${cactus.framework.jar}"/>
>                 <available file="${cactus.ant.jar}"/>
>                 <available file="${servlet.jar}"/>
>                 <available file="${aspectjrt.jar}"/>
>                 <available file="${commons.httpclient.jar}"/>
>                 <available file="${httpunit.jar}"/>
>                 <available file="${junit.jar}"/>
>            </and>
>         </condition>
> 
>     </target>
> 
>     <target name="check.properties" depends="set.properties.ok"
> unless="properties.ok">
>         <fail message="Missing property or property pointing to an
invalid
> file (check your build.properties file)"/>
>     </target>
> 
> Note the addition of a new target and the renaming of the old target.
> 

Yes, that's what I had before I switched to the "unless" attribute in
the fail task. The sample application was supposed to work with Ant 1.4
but I forgot to check that (I'm running Ant 1.5).

Thanks, I'll collect all these problems and in a week or so I'll deliver
a new Cactus 1.3.1 version.

-Vincent



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to