Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Netbeans and external configuration files

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.

like image 268
Joakim Karlsson Avatar asked Nov 19 '08 08:11

Joakim Karlsson


1 Answers

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.

like image 185
Michel Avatar answered Sep 21 '22 01:09

Michel