我怎么能包括文件夹放到DIST JAR作为使用NetBeans构建过程的一部分吗? [英] How can I include a folder into the dist JAR as part of the build process using Netbeans?
问题描述
我使用NetBeans 6.9,我也看着编辑build.xml文件,这样我可以包括从建设项目产生的jar文件的目录和文件。
I'm using Netbeans 6.9 , and I have looked into editing the build.xml file so that I can include directories and files in the jar file that results from building the project.
所以我的问题是如何修改我的build.xml文件放在其他文件夹中的罐子?
我有以下的目录结构为我的项目
I have the following directory structure for my project
PROJECTDIR /结果
/图像/结果
/ src目录/ COM / ...结果
/ lib目录/结果
等..
和我想的Ant构建脚本生成JAR文件看起来像
And I want the jar file built by the ant build script to look like
project.jar
结果 / COM
结果 / lib目录
- 这应该包括lib文件夹里面搜索的jar文件 /图片
- 这应该包括JPG文件结果 / META-INF
project.jar
/com
/lib
--this should include the jar files inside the lib folder
/images
--this should include the jpg files
/META-INF
我需要做的,因为我安装jar文件到Adobe ActionScript 3.0语言作为一个自定义组件和所有的lib jar文件和图像需要被包含在瓶子里。
I need to do this because I "install" the jar file into Adobe Livecycle as a custom component and all of the lib jar files and images need to be included in the jar.
另外,如果是有办法做到这一点不使用,将被罚款也build.xml文件,目前我只是文件夹/文件复制到jar文件。
Also if there is a way to do this without using the build.xml file that would be fine also, currently I'm just copy the folders/files into the jar file.
推荐答案
的http:// ant.apache.org/manual/Tasks/copydir.html
<copydir src="${base.path}/lib/"
dest="${build.path}/lib"
/>
<copydir src="${base.path}/images/"
dest="${build.path}/images"
/>
<copydir src="${base.path}/src/com/"
dest="${build.path}/com"
/>
<copydir src="${base.path}/META-INF/"
dest="${build.path}/META-INF"
/>
http://ant.apache.org/manual/Tasks/jar.html
<jar destfile="project.jar"
basedir="${build.path}"
includes="**/*.*"
/>
这篇关于我怎么能包括文件夹放到DIST JAR作为使用NetBeans构建过程的一部分吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!