views:

26

answers:

1

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="${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> 

How can I move the properties file into the correct classes directory?

+1  A: 

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.

Mark O'Connor