views:

1353

answers:

2

I am developing a Java desktop application and would like to have an external configuration.xml.
I am developing the application using Netbeans and tried to add the configuration.xml file in the dist directory so that it resides in the application work folder. But when Netbeans executes its clean operation it deletes the dist directory,
Where should I put this configuration.xml file so that it will not be deleted and will exist in the application start-up directory.

+6  A: 

You can add this to your build.xml :

<target name="-post-jar">
   <copy todir="${dist.jar.dir}">
       <fileset dir="resources" includes="**"/>
   </copy>        
</target>

You can now put your configuration.xml file in the folder 'resources' (that you need to create) in your project and all files in it will be copied to the dist folder during the build process.

Michel
A: 

Thanks Michel for your help. Really good one for the beginers

Amit