ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Russell G. Wells" <rgwe...@pacbell.net>
Subject Problem with condition task
Date Sun, 21 Jul 2002 06:41:20 GMT

I am getting an "Unexpected element" error whenever the "condition" tag
is used in an ant build.xml file.  As the following build file
indicates, the condition task is being used inside a target so the
obvious error does not apply. In fact the condition section is taken
from the ant documentation.  

I'm guessing that this has to do with my machine configuration, but I've
tried all I can think of.  My development environment is OS = Windows XP
pro, JDK 1.3.1_02, ANT 1.5.  

ANT_HOME=c:\java\ant-1.5
JAVA_HOME=c:\java\jdk-1.3.1
ANT_OPTS=-Dbuild.compiler=jikes
PATH=C:\Windows\system32;C:\Windows;c:\java\jdk1.3.1\bin;C:\java\ant-1.5
\bin;
CLASSPATH=

As you can see my environment can't get much simpler (for windows at
least).  I have added bsf.jar and js.jar to the C:\java\ant-1.5\lib
directory.

Any ideas appreciated!


Test build file -----------------------------------

<?xml version="1.0" ?>
<project name="Test" default="junk" basedir=".">

	<target name="junk"/> 
		<condition property="javamail.complete">
			<and>
				<available
classname="javax.activation.DataHandler" />
				<available
classname="javax.mail.Transport" />
			</and>
		</condition>
		<echo message="${javamail.complete}"/>
	</target>
	

</project> 



Sample output ---------------------------------------

C:\projects\sr>ant -v -f build_rgw.xml junk
Apache Ant version 1.5 compiled on July 9 2002
Buildfile: build_rgw.xml
Detected Java version: 1.3 in: C:\java\jdk1.3.1\jre
Detected OS: Windows 2000
parsing buildfile build_rgw.xml with URI =
file:C:/projects/sr/build_rgw.xml
Project base dir set to: C:\projects\sr

BUILD FAILED
file:C:/projects/sr/build_rgw.xml:5: Unexpected element "condition"
        at
org.apache.tools.ant.helper.ProjectHelperImpl.parse(ProjectHelperImpl.ja
va:170)
        at
org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:1
17)
        at org.apache.tools.ant.Main.runBuild(Main.java:597)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)

Total time: 0 seconds
C:\projects\sr>




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


Mime
View raw message