views:

17

answers:

1

I have an project in NetBeans. I made some preparations to make database migration easier, and I put all things related to migration in one folder in root of my project. Now I want to make this whole directory included in the distribution jar or war.

I deducted that i have to modify the ="-pre-dist" target, but I not very familiar with and and I'm lost in all of these netbeans options, paramaters predefined in build script.

Assuming my migration data is in folder "migration", how should ant command look to include this folder in distrubution archive?

+1  A: 

I understood from your question that you want to achieve the following:

  1. You have a directory migration with some contents in the root of the project
  2. You want this directory to be included in the JAR file created as a result of clean and build command in NetBeans IDE

To achieve this add the following ANT target in your build.xml file:

<target name="-pre-jar">
    <mkdir dir="${build.classes.dir}/migration"/>
    <copy todir="${build.classes.dir}/migration">
        <fileset dir="${basedir}/migration"/>
    </copy>
</target>

Now when you run the command clean and build the resulting JAR file will contain the folder migration with all the contents. Note: this target is not "-pre-dist" but is "-pre-jar"

with regards
Tushar

Tushar Joshi
You understood me perfectly and this is exactly what I meant ;)
jjczopek