views:

392

answers:

2

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
+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
But specifically is there away to have the command infer /com/cross/xxx ?
C. Ross
No, Ant can not read your mind as to what you want it to do.
@carej Ant seriously needs that new mind reading feature suite.
C. Ross