ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olivier De Wolf <o...@skynet.be>
Subject creating Project from build.xml does not load the property tag ???
Date Tue, 29 Oct 2002 06:58:52 GMT
Hi,

I would like to create a Project Object from a build.xml file. My code  
is inspired from org.apache.tools.ant.Main.

Here is my build.xml :

<project name="myProject" default="myDefault" basedir=".">
	<!--<property name="myProp" value="myProp"/>-->
	<target name="myDefault">
		<echo message="Hello"/>
	</target>
</project>

Here is my code :

Project project = new Project();
ProjectHelper.configureProject(project, new File("build.xml"));
project.init();
project.executeTarget("myDefault");


In that case everything works fine. The problem arises when I uncomment  
the <property> tag in the build file.
I receive this error message :

Class org.apache.tools.ant.UnknownElement doesn't support the "name"  
attribute.
	at  
org.apache.tools.ant.IntrospectionHelper.setAttribute(IntrospectionHelpe 
r.java:422)
	at org.apache.tools.ant.ProjectHelper.configure(ProjectHelper.java:306)
	at  
org.apache.tools.ant.helper.ProjectHelperImpl$TaskHandler.init(ProjectHe 
lperImpl.java:812)

(with a big following stackTrace).

The problem seems to be the name attribute of the <property> tag !!!

What is my mistake?


Thanks in advance,

Olivier


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


Mime
View raw message