• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 5
  • 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.
 
We noticed he had no friends. So we gave him this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic