开发者

How to get Ant to copy properties file to classes directory

I have a project which I can build and deploy correctly using Ant

I want to build a war file to deploy the project.

I can get everything working except I cannot get the properties file to appear in the classes directory.

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="${r开发者_Python百科esources_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> 

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜