如何在使用 Netbeans 的构建过程中将文件夹包含到 dist JAR 中?
我正在使用 Netbeans 6.9 ,并且我已研究过编辑 build.xml 文件,以便可以将目录和文件包含在构建项目所生成的 jar 文件中。
所以我的问题是如何修改 build.xml 文件以将其他文件夹放入 jar 中?
我的项目有以下目录结构
ProjectDir/
/图片/
/src/com/...
/lib/
等等..
我希望 ant 构建脚本构建的 jar 文件看起来像
project.jar
<代码>/com/lib
--这应该包括 lib 文件夹内的 jar 文件/images
--这应该包括 jpg 文件/META-INF
我需要这样做,因为我将 jar 文件作为自定义组件“安装”到 Adobe Livecycle 中,并且所有 lib jar 文件和图像都需要包含在该 jar 中。
另外,如果有一种方法可以在不使用 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.
So my question is How do I modify the build.xml file to put other folders in the jar?
I have the following directory structure for my project
ProjectDir/
/images/
/src/com/...
/lib/
and so on..
And I want the jar file built by the ant build script to look like
project.jar
/com
/lib
--this should include the jar files inside the lib folder/images
--this should include the jpg files/META-INF
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.
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
http://ant.apache.org/manual/Tasks/copydir.html
http://ant.apache.org/manual/Tasks/jar.html
http://ant.apache.org/manual/Tasks/copydir.html
http://ant.apache.org/manual/Tasks/jar.html
如果有人看到这个,copydir 现在已被弃用,请使用:
In case someone see this, copydir is deprecated now, use: