• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Defining Ant build.xml java properties files for a run targer

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am writing a build.xml file for a standalone java class which uses five ???.properties files. I need to know how to define these within build.xml.

I have tried a number of combinations, and get a file not found exception (from MyClass for the run target).

I have tried:


<path id ="loadVals">
<fileset dir="../properties">
<include name="*.properties"/>
</fileset>
</path>

AND:

<property file="../properties/log4j.properties"/>
<property file="../properties/one.properties"/>
<property file="../properties/two.properties"/>
<property file="../properties/three.properties"/>
<property file="../properties/four.properties"/>

------



Can someone please tell me how to define the five properties files. Thank you (please find build.xml below).



Miles.




 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please use code tags; without them code and configs are essentially impossible to read.

If you're talking about referencing the files during run time it depends on how you're accessing the files. If you're reading them in as resources they need to be on the classpath of the program itself. The property file tag in an Ant file is for defining *Ant* properties. If you're reading them in as files then you need to reference the actual file path from the standpoint of the executing program.
 
I like tacos! And this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic