Java Mailing List Archive

http://www.ant-tasks.com/

Home » Ant Users List »

Re: Disable Static content

Steve Loughran

2008-03-04

Replies: Find Java Web Hosting

Author LoginPost Reply
Mevi wrote:
> Hi,
>
> In our project we would like to disable file serving. Via RAD one can edit
> the Web Deployment Descriptor. Under the extensions tab there is a check box
> for "File serving enabled" . What happens under the covers is that the
> ibm-web-ext.xmi file is modified. The attribute is for fileServingEnabled is
> set to false. This is only applicable when running on the servers and not
> our development environment. Thus we want it to be set when we build.
> However the catch we do not want this put into clear case. That is the file
> ibm-web-ext.xmi only gets modified for the artifact and not the source code.
>
>
> Is this doable? ie Can ANT change the ibm-web-ext.xmi file contents during
> the build in Anthill Pro?
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <webappext:WebAppExtension xmi:version="2.0" xmlns:xmi="
> http://www.omg.org/XMI" xmlns:webappext="webappext.xmi"
> xmi:id="WebAppExtension_1186668401406" reloadInterval="3"
> reloadingEnabled="true" additionalClassPath="" fileServingEnabled="false"
> directoryBrowsingEnabled="false" serveServletsByClassnameEnabled="false">
>
> <webApp href="WEB-INF/web.xml#WebApp_ID"/>
>
> </webappext:WebAppExtension>
>
> Thanks!



I would recommend you have a file with all the settings set from ant
properties

fileServingEnabled="${webapp.fileServingEnabled}"

Then you take the this template and <copy> it with property expansion

Here is a presetdef template

  <!--preset to copy with ant property expansion (and always overwrite)-->
  <presetdef name="expandingcopy">
   <copy overwrite="true">
    <filterchain>
      <expandproperties/>
    </filterchain>
   </copy>
  </presetdef>

That you can use whenever you need to, such as when patching izpack xml
files or RPM .spec files:

  <expandingcopy todir="${build.dir}">
    <fileset file="izpack/install.xml"/>
  </expandingcopy>

  <expandingcopy todir="${rpm.SPECS}">
    <fileset dir="${rpm.metadata.dir}" includes="**/*.spec"/>
  </expandingcopy>

-steve
--
Steve Loughran            http://www.1060.org/blogxter/publish/5
Author: Ant in Action       http://antbook.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.