如何获得Ant来的属性文件复制到classes目录 [英] How to get Ant to copy properties file to classes directory
本文介绍了如何获得Ant来的属性文件复制到classes目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有我可以构建和使用Ant正确部署一个项目
I have a project which I can build and deploy correctly using Ant
我想建立一个war文件部署项目。
I want to build a war file to deploy the project.
我可以得到除了我的一切工作不能得到的属性文件出现在classes目录下。
I can get everything working except I cannot get the properties file to appear in the classes directory.
我的属性文件位于:
$ {resources_dir} / $ {}应用/Report.properties
My properties file is located here: ${resources_dir}/${app}/Report.properties
这是我的构建文件的战争部分:
This is the war section of my build file:
<war destfile="${dist_dir}/${app}.war" webxml="${resources_dir}/${app}/web.xml">
<fileset dir="${resources_dir}/${app}" includes="*.jsp,*.jspf,*.html,*.css" />
<zipfileset dir="${resources_dir}/${app}/webct" prefix="webct" />
<zipfileset dir="${resources_dir}/${app}/css" prefix="css" />
<zipfileset dir="${resources_dir}/${app}/js" prefix="js" />
<zipfileset dir="${resources_dir}/${app}/images" prefix="images" />
<classes dir="${build_dir}" includes="com/mycompany/${app}/*,com/mycompany/${app}/tixdata/*" />
<lib dir="${commonlib_dir}">
<include name="common.jar"/>
</lib>
</war>
我如何可以将属性文件到正确的classes目录?
How can I move the properties file into the correct classes directory?
推荐答案
只要指定一个额外的类元素
Just specify an additional classes element
<war destfile="${dist_dir}/${app}.war" webxml="${resources_dir}/${app}/web.xml">
..
<classes dir="${resources_dir}/${app}" includes="Report.properties"/>
..
</war>
这是文件集的一种特殊形式。
It's just a special form of fileset.
这篇关于如何获得Ant来的属性文件复制到classes目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文