This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Miles Davenport
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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.




 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic