Modification of NetBeans Ant build script
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 i开发者_运维问答n 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?
I understood from your question that you want to achieve the following:
- You have a directory migration with some contents in the root of the project
- 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"
精彩评论