aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Odd behavior when loading properties with ant Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Odd behavior when loading properties with ant" Watch "Odd behavior when loading properties with ant" New topic
Author

Odd behavior when loading properties with ant

David Brossard
Ranch Hand

Joined: Jun 03, 2004
Posts: 109

One can use variables inside variables in an ant build properties file e.g.


The above statement works if and only if the properties file is referenced to from within the build.xml file with the usual


If I use ant build.xml -propertyfile foo.properties, then it doesn't replace ${lib.dir} with the right value. Why???

This seems to be a bug for me.


No matter what they say in Ohio, we're still first in flight!
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What if you put the option first, and don't specify the build file incorrectly?
Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
David Brossard wrote:
ant build.xml -propertyfile foo.properties


It should not work at all. The correct call would be



or

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

That's kind of what I said.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

Maybe it is just me, but I think that the command line syntax is a red herring: http://faq.javaranch.com/java/AvoidRedHerrings

My recommendation is to look at the Ant source code, see why the behavior is as you describe (I have verified that it works as you said), and then open an issue report with Ant, submitting the patch to fix it.


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Odd behavior when loading properties with ant