How to include file in Jar through Ant at specific location

Viewed 20767

I've got an ant jar task:

<target name="jar">
    <jar destfile="${generated.jars.dir}/hello-${environment}.jar">
        <fileset dir="${generated.classes.dir}"/>
        <fileset dir="${environment.dir}/${environment}" includes="config.xml"/>
    </jar>
</target>

How can I force the config.xml file to be pushed to a specific directory in the jar rather than at the root level, say in /database/config.xml or something like that...

PS: The reason for doing this is that I can have a hello-local.jar, hello-dev.jar, hello-qa.jar, etc.

3 Answers
Related