ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mark.rus...@pncbank.com
Subject Re: Including Directories while creating WAR File (New Bie)
Date Fri, 30 May 2003 12:40:57 GMT
I'm assuming that you want all the code in the web directory in your war.
If you want to exclude certain directories then add exclude name="???"/> to
the list (say you want to excldue dtd it would look like <exclude name="
**/dtd"/>).

I'd try:
<property name="app.root" location="${basedir}"/>
<property name="web.root" value="${app.root}/web"/>
<property name="web.webinf" value="${web.root}/WEB-INF"/>
<target name="war" depends="compile">
  <war warfile="webi2v.war" webxml="${web.webinf}/web.xml">
    <fileset dir="${web.root}"/>
      <exclude name="**/*.jar"/>
      <exclude name="**/*.class"/>
      <exclude name="**/*.properties"/>
      <exclude name="**/web.xml"/>
    </fileset>
    <webinf dir="${web.webinf}" excludes="**/web.xml"/>
    <lib dir="${web.webinf}/lib"/>
    <classes dir="${web.webinf}/classes"
             includes="**/*.properties,**/*.classes"/>
  </war>
</target>


Thursday, May 29, 2003 11:47 AM
To: "'Ant Users List'" <user@ant.apache.org>
cc:
From: "Sachin Chowdhary" <csachin@pisoftek.com>
Subject: Including Directories while creating WAR File (New Bie)



Hi my Application has this Directory Struture while developing System

  WebApp
        |__build.xml
        |__build.properties
        |__build\
        |__src\
        |      |__com\
        |__web\
                |__css\
                |__dtd\
                |__img\
                |__xml\
                |__xsd\
                |__xsl\
                |__WEB-INF\
                        |__classes\
                     |__log4j.properties
                        |__lib\
                        |__tlds\
                        |__web.xml
              |__struts-config.xml

   Now i have to Deploy this Application.Intially i have used blank war
file
with struts and then create directories in WebApp Folder
   But now Problem is that when i am deploying it with Ant it is only
creating

         |__WEB-INF\
                        |__classes\
                     |__log4j.properties
                        |__lib\
                        |__tlds\
                        |__web.xml
              |__struts-config.xml

how can i include css,dtd,xml,xsl directories please help me.My build file
Target which is creating WAR file is.


<target name="war" depends="compile">
         <war warfile="webi2v.war" webxml="./web/WEB-INF/web.xml">
             <fileset dir="./" includes="./web/**/*.*"
excludes="**/web.xml">
               <exclude name="**/*.jar"/>
               <exclude name="**/*.class"/>
               <exclude name="**/*.properties"/>
               <include name="./web/css/*.*"/>
               <include name="./web/xml/*.*"/>
               <include name="./web/xsd/*.*"/>
               <include name="./web/javascript/*.*"/>
               <include name="./web/*.*"/>
             </fileset>
             <webinf dir="./web/WEB-INF" includes="**/*"
excludes="**/web.xml"/>
             <lib dir="./web/WEB-INF/lib"/>
             <classes dir="./web/WEB-INF/classes"
includes="**/*.properties,**/*.classes"/>
         </war>




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



Mime
View raw message