Wednesday, April 13, 2011

Create Apache,s Projects Structure using ANT

1 . create bat file
2. create script file (*.XML)
3. put the src folder with above 2 file.
4. put WebPages folder at same location.
5. Command to create War file : ant -buildfile <buildfilename.xml>
------------------------------------------------------------------------------------------

<?xml version="1.0" ?>
<project name="AntExample1" default="war" >
   
     <path id="compile.classpath" >
        <fileset dir="WebPages/WEB-INF/lib">
            <include name="*.jar"/>
        </fileset>
    </path>

    <target name="MakeDirectory">
        <mkdir dir="classes"/>
    </target>
  
    <target name="compile" depends="MakeDirectory">
        <javac srcdir="src" destdir="classes" includeantruntime="false" >
        <classpath refid="compile.classpath"/>
        </javac>
    </target>

    <target name="war" depends="compile">
        <war destfile="jarfile\AntExample.war" webxml="WebPages\WEB-INF\web.xml">
            <lib dir="WebPages/WEB-INF/lib"/>
            <classes dir="classes"/>
            <fileset dir="WebPages"/>
        </war>
    </target>
 
</project>


No comments:

Post a Comment

Disqus for yogi's talk

comments powered by Disqus