ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Nitz <greenwindows...@yahoo.de>
Subject available file not available
Date Tue, 27 Jan 2004 22:55:32 GMT
Hi!
I'm new to ant, java and linux so maybe I'm asking
something very obvious.
I have installed ant 1.5.4 and 1.6 and the problem
arises with both.
(JDK j2sdk1.4.1_02, eclipse 3.0)

I tried to modify an existing build.xml (and
build.properties) but the build fails miserably
already when checking the existence of files.
I am sure the given file exists and its access rights
should be ok, too.
The strange behaviour is the following:
"available" (in the checkRequiredFile target) works
when passing the path of the file as a param
"available" fails when passing a variable containing
the path of the file as a param



These are experpts of my build.xml :

------------------------------------------- start
snippet
     <target name="verifyPreconditions"
description="Verify all jars exist">
         <echo>servlet.jar = ${servlet.jar}</echo>
         <echo>servlet.jar =
/opt/Java/jakarta/jakarta-tomcat-5.0.16/common/lib/servlet-api.jar</echo>

       <antcall target="checkRequiredFile">
          <param name="file"
value="/opt/Java/jakarta/jakarta-tomcat-5.0.16/common/lib/servlet-api.jar"/>
          <param name="fail.message" value="basic test
failed"/>
       </antcall>
 99:   <antcall target="checkRequiredFile">
          <param name="file" value="${servlet.jar}"/>
          <param name="fail.message" value="basic test
failed"/>
       </antcall>

  ...

     <target name="checkRequiredFile">
         <echo>file        = ${file}</echo>
       <available file="${file}"
property="requirement.satisfied"/>
159:   <antcall target="checkRequired.fail"/>
     </target>

     <target name="checkRequired.fail"
unless="requirement.satisfied">
         <echo>failed file = ${file}</echo>
164:   <fail message="${fail.message}"/>
     </target>

  ...

------------------------------------------- end
snippet


I get the following output :

------------------------------------------- start
snippet
Buildfile: build.xml

verifyPreconditions:
     [echo] servlet.jar =
/opt/Java/jakarta/jakarta-tomcat-5.0.16/common/lib/servlet-api.jar
     [echo] servlet.jar =
/opt/Java/jakarta/jakarta-tomcat-5.0.16/common/lib/servlet-api.jar

checkRequiredFile:
     [echo] file        =
/opt/Java/jakarta/jakarta-tomcat-5.0.16/common/lib/servlet-api.jar

checkRequired.fail:

checkRequiredFile:
     [echo] file        =
/opt/Java/jakarta/jakarta-tomcat-5.0.16/common/lib/servlet-api.jar

checkRequired.fail:
     [echo] failed file =
/opt/Java/jakarta/jakarta-tomcat-5.0.16/common/lib/servlet-api.jar

BUILD FAILED
/home/snitz/Projects/eclipse/carddemo/build.xml:99:
Following error occured while executing this line
/home/snitz/Projects/eclipse/carddemo/build.xml:159:
Following error occured while executing this line
/home/snitz/Projects/eclipse/carddemo/build.xml:164:
basic test failed

------------------------------------------- end
snippet

I really can't figure out why it fails

Your help is appreciated
Thanks,

Stephen

________________________________________________________________________
BT Yahoo! Broadband - Free modem offer, sign up online today and save £80 http://btyahoo.yahoo.co.uk

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


Mime
View raw message