我怎么能包括使用Ant罐子数据的文本文件? [英] How can I include data text files in a jar using Ant?

查看:117
本文介绍了我怎么能包括使用Ant罐子数据的文本文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我src文件夹有包含文件DATA1.TXT和data2.txt称为数据另一个文件夹。该应用程序加载从初始化这些文件的图形,所以我想在我最后的jar这些文件。我使用Ant生成jar文件。

In my src folder there is another folder called data which contains files data1.txt and data2.txt. The application loads a graph from these files in the initialization, so I want to include these files in my final jar. I use Ant to produce the jar file.

推荐答案

HTTP示例: //ant.apache.org/manual/Tasks/jar.html :

  <jar destfile="${dist}/lib/app.jar">
    <fileset dir="${build}/classes"/>
    <fileset dir="${src}/resources"/>
  </jar>

所以基本上你会想在同样的方式为资源的数据文件都包含以上。

So basically you would want to include the data-files in the same way as "resources" are included above.

从文档中的&LT;&罐子GT; 任务:

有可能缩小正在震动的组文件。这可以通过包括完成,includesfile,排除,excludesfile和defaultexcludes属性

It is possible to refine the set of files that are being jarred. This can be done with the includes, includesfile, excludes, excludesfile and defaultexcludes attributes.

这篇关于我怎么能包括使用Ant罐子数据的文本文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆