如何告诉 ant 构建文件将 bin 目录中的所有文件递归添加到 jarfile 中?
我有以下 ant 构建文件,该文件应该将 bin 目录中的所有类文件打包到 jarfile 中:
<?xml version="1.0" encoding="utf-8"?>
<project name="RemoteJunitXletServer.makejar" default="makejar" basedir=".">
<target name="makejar" description="Build a jarfile based on the JunitServer project">
<jar jarfile="JunitServer.jar" includes="**.class" basedir="bin" />
</target>
</project>
不幸的是,包括“**.class”仅深入两个目录,并且不会复制任何比两个目录更深的文件bin 文件夹里面。这些目录是否必须显式声明?或者有没有办法告诉 Ant 仅复制 bin 文件夹内的所有类文件,而不管位置如何,同时保留文件夹结构?
I have the following ant build file which is supposed to package all class files in the bin directory into a jarfile:
<?xml version="1.0" encoding="utf-8"?>
<project name="RemoteJunitXletServer.makejar" default="makejar" basedir=".">
<target name="makejar" description="Build a jarfile based on the JunitServer project">
<jar jarfile="JunitServer.jar" includes="**.class" basedir="bin" />
</target>
</project>
Unfortunately, including "**.class" only goes two directories deep, and does not copy any files that are deeper than two directories inside of the bin folder. Do these directories HAVE to be explicitly declared? Or is there a way to tell Ant to just copy all class files inside of the bin folder regardless of location while preserving the folder structure?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试
includes="**/**.class"
...Try
includes="**/**.class"
...