ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Cody <paul.c...@lucida.com>
Subject RE: war task and webinf
Date Wed, 13 Mar 2002 03:49:58 GMT
> 
> If I do this:
> <webinf>
>     <fileset dir="${conf.dir}">
>         <include name="TurbineResources.properties"/>
>         <include name="intake.xml"/>
>     </fileset>
>     <fileset dir="path/to/custom/conf" includes="file.properties"/>
> </webinf>
> 
> If I am correct this will copy everything in ${conf.dir} into WEB-INF
> (unless I am completely unclear on how the task works =) and the
> file.properties file into WEB-INF as well.
> 
> Now if <webinf> treats <filesets> differently it should 
> really be mentioned
> in the docs. But regardless, how would I treat my custom 
> properties file and
> how would I tell the <war> task explicitly which folder to put it in?
> 

No, the <webinf> *is* the fileset, it does not include them.  So try this:

<war warfile="..." webxml="..." manifest="...">
  <fileset dir="${jsp.dir}"/>
  <webinf dir="${conf.dir}">
    <include name="TurbineResources.properties"/>
    <include name="intake.xml"/>
  </webinf>
  <webinf dir="${custom.conf.dir}">
    <include name="file.properties"/>
  </webinf>
</war>

But I see what you are getting at now:  nowhere in your source tree does
conf/ exist, and you want to create it.  I personally don't know how to both
select a fileset and map it to a new location at the same time, so if it
were my build.xml file, I would prepare a temporary webinf directory using
<copy> and then include everything in that with <webinf>.

<target name="war">
  <mkdir dir="${tmp.webinf}/conf"/>
  <copy todir="${tmp.webinf}/conf">
    <fileset dir="${conf.dir}">
      <include name="TurbineResources.properties"/>
      <include name="intake.xml"/>
    </fileset>
    <fileset dir="${custom.conf.dir}">
      <include name="file.properties"/>
    </fileset>
  </copy>
  <war warfile="..." webxml="..." manifest="...">
    <fileset dir="${jsp.dir}"/>
    <webinf dir="${tmp.webinf}"/>
  </war>
  <delete dir="${tmp.webinf}"/>
</target>

HTH,
Paul

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message