I'm trying to use Apache Commons Configuration and using ant for my build tool. I have one namespaced class, and when ant builds it of course sub-directories. I need to put my .xml configuration file in the leaf directory (ie: ${build}/com/cross/xxx/). Is there an automated way to do this, or do I just manually configure the path of the leaf folder?
A:
You would store your xml in the required directory in your project, either with the source file or prefereably in a separate tree eg. resources/com/cross/xxx And simply copy the entire directory tree to your build directory
objects
2009-06-12 01:36:28
+1
A:
Check out the Ant copy
task. You'll want to do something like this (assuming a name config.xml
for your XML config file:
<copy file="config.xml" todir="${build}/com/cross/xxx/" preservelastmodified="true"/>
Of course, preservelastmodified
is optional. The copy command is very powerful; above is the simplest possible sample of what it can do.
Eddie
2009-06-12 01:59:56
But specifically is there away to have the command infer /com/cross/xxx ?
C. Ross
2009-06-12 12:05:00
No, Ant can not read your mind as to what you want it to do.
2009-06-12 12:10:16
@carej Ant seriously needs that new mind reading feature suite.
C. Ross
2010-09-08 13:54:17