ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject Re: "resource" vs. "file" in <property> task
Date Thu, 21 Dec 2000 00:42:14 GMT
--- Bill Burton <> wrote:
> This confused me too as the docs aren't clear on the distinction so I
> looked at the source to get the answer.  The file attribute does what
> you would expect and loads a file from the file system.  The resource
> attribute also loads a file but finds the file by calling
> getClass().getResourceAsStream("") causing it to be loaded
> from the CLASSPATH which includes looking inside .jar's in the

That's what I finally ended up doing as well -- looking at the source-code
for <property> (only I had to look up getResourceAsStream over on the java
site as well :)

So, there's two issues I still have then: 1) it doesn't appear to work,
and 2) doesn't it imply that <property> should allow for nested

As to 1 -- I tried putting the jar-file that contains the property file
into $ANT_HOME/lib, since I knew it'd get scooped up into java.class.path
along with all the other Ant jars, then I tried <echo>'ing out one of the
properties defined in that file, but it came out as the un-resolved
${property-name} string instead of the value the property should have been
set to.

As to 2 -- clearly, putting my jar-file in ant's lib dir was a kludge
around the fact that you can't specify <classpath> within <property>,
which is why I've now included ant-dev in the To line, along with the fact
that using the "resource" attr doesn't appear to have actually worked
regardless of my kludge -- maybe someone on there would like a diversion
away from the Dueling Proposals and just do a little coding :)



Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.

View raw message