|  Home   |  About Us   |  Online Exam   |  Tech World   |  Jobs    | Member Login

   Ant

Ant Installation
Sample ant build file-JAR
Ant ecllipse IDE integration
Sample ant build file-WAR
Ant properties file

Ant Eclipse IDE Integration

To integrate Ant build file with the Eclipse IDE, first create a build.xml file, right click the project select New->Other->XML, enter the name as build.xml and click Finish.

        <?xml version="1.0" ?>
        <project name="Ant Example" default="execute">

        <target name="init" depends="clean">
        <mkdir dir="build/classes" />
        </target>

        <target name="compile" depends="init">
        <javac srcdir="src" destdir="build/classes" />
        </target>

        <target name="execute" depends="compile">
        <java classname="com.chennaisunday.helloworld.HelloWorld" classpath="build/classes" />
        </target>

        <target name="clean">
        <delete dir="build" />
        </target>

        </project>
        

To build the project right click the build.xml file and select Ant Build.


The HelloWorld.java file will be compiled and executed. The following message shows the sequence of events that happen once the build file is executed.

        Buildfile: E:\Eclipse Workspace\AntExample\build.xml
        clean:
        [delete] Deleting directory E:\Eclipse Workspace\AntExample\build
        init:
        [mkdir] Created dir: E:\Eclipse Workspace\AntExample\build\classes
        compile:
        [javac] Compiling 1 source file to E:\Eclipse Workspace\AntExample\build\classes
        execute:
        [java] Hello World!
        BUILD SUCCESSFUL
        Total time: 625 milliseconds


 

               Our Portals  :   www.righttimeproperty.com   |   www.sundaychennai.com   |   www.dorabuji.com