ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Webb, James" <james.w...@vignette.com>
Subject RE: v1.3 -- problems retrieving properties from <property file="S OMEF ILE">
Date Wed, 02 May 2001 14:21:49 GMT
the properties are not being set when i use them. 
i have tried to use them in other tasks without
success. 

also the properties from my file are
not referring to other properties. each is explicit
with its own key and value.

also i am not using the properties from the file as the 
basis for any other properties within my project.
I am using their keys directly in each task i have tried.


i have tried
	1. using one of the properties in a replace task
		on a file with a token.
	2. using the mkdir task to create a directory named
		after one of the properties
	3. using the mail task to send the value of one of the
		properties as part of the message.
	4. using the echo task to output the value of the property.

In all of these cases the output is the property name not its value

	${weblogic.webapp.name}

instead of

	mywebapp


I am not sure else what to try.

-----Original Message-----
From: Conor MacNeill [mailto:conor@cognet.com.au]
Sent: Wednesday, May 02, 2001 7:06 AM
To: ant-user@jakarta.apache.org
Subject: Re: v1.3 -- problems retrieving properties from <property
file="SOMEF ILE">


From: "Diane Holt" <holtdl@yahoo.com>
> --- Nico Seessle <nico@apache.org> wrote:
> > > (Maybe this should go in the FAQ.)
> > >
> > The better place would be Bugzilla with a little testcase :-) So we can
> > fix that and don't need to describe wrong behaviour...
>
> As I recall, it may not be fixable -- I think it has to do with the order
> in which properties get set. That is, if you have something like:
>
> root.dir=/my/tree
> out.dir=${root.dir}/classes
>
> you will likely get a log message saying that property root.dir isn't
set.
> Conor could probably explain it in more detail.
>

OK, when reading in from a properties file, you can ignore this message :-)

What happens is this:

The properties are read in as a Properties object. They are then read out
with an enumeration and added to Ant's collection of properties. The order
of properties returned by that enumeration is, in general, not the same as
the order of the properties in the file. So, there may effectively be
forward references in the order returned by the enumeration. When this
occurs, Ant will print this message but then resolve the forward reference
within the properties object from the properties file.

In other words, properties in a properties file are more declarative than
those in a build file :-).

Now I agree that the warning there is a problem. The reason I left it in,
however, is that it is generally very difficult to catch use of properties
which are not set. I'll probably get rid of it now.

So, to the original poster, if you ignore the messages, can you check that
the values are actually being set correctly.

Sorry for the confusion.

Conor


Mime
View raw message