Friday, December 7, 2012

Apache Ant – Building Simple Java Projects


Ant Tutorial

By using this tutorial you can easily and quickly learn how to use Ant to build  java projects.

Ant Definition

Apache Ant is an open source, cross-platform based build tool that is use XML scripting to build  Java applications. Ant supplies a number of built-in tasks allowing to compile, assemble, test and run Java applications. Ant can also be used effectively to build non Java applications. More generally, Ant can be used to pilot any type of process which can be described in terms of targets and tasks.

Apache Ant Overview

Ant is developed by Apache Foundation specifically to build projects based on java platform. Ant is an abbreviation forAnother Neat Tool.

A Java build process typically includes:
  • the compilation of the Java source code into Java Bytecode
  • creation of the .jar file for the distribution
  • creation of the Documentation
Ant uses anXMLfile for its configuration. You can’t give any name to this file, this file is usually calledbuild.xmlIt builds are based on three blocks: taskstargets and extension points .
A task is a individual work like compile source code or creating Javadoc. More than one task can be combine to form a group called targets.
A target can be directly invoked via Ant. Targets can specify their dependencies  using “depends” attribute. Ant tool will automatically execute dependent targets.
For example if target Run depends on Compile, than Ant will first perform Compile and then Run.
<target name="compile">
 ...................
   </target>
<target name="run" depends="compile">
 ...................
   </target>
In yourbuild.xmlfile you can specify the default target. Ant will execute this target, if no explicit target is specified.

History of Ant

The development of Ant technology originated as an integral component of Tomcat application server based on Java Servlet and Java Server Faces. Ant, as a part of Apache Jakarta Project is an open source solution based on java platform.  Ant used as a major tool in building java projects and now it has become a top-level Apache project for server-side solutions. The latest release of Ant is version 1.8.4.
Introduction to Apache Ant (Another Neat Tool)
Ant is an open source build technology developed by Apache intended to build processes in Java environment. Ant is based on XML and uses java classes in automatic generation of build processes that makes it platform independent. It is applicable to any integrated development environment (IDE) that uses java. A build file is generally named asbuild.xml (can’t be other than build.xml).
The best features of the Ant technology can be summarized as below -
  • · Easy to Use: As it is an XML based scripting tool, therefore easy to understand and implement.
  • · Portable and Cross-platform based:  it can be run on any operating system.
  • · Extended Functionality:  It is easier to implement than any specific IDE because it is automated and ubiquitous.
  • · Build Automation: Ant provides automated build processes that is faster and more efficient than manual procedures and other build tools can also be integrated with it.
  • · Compilation of Source Code: Ant can use and compile source code from a variety of version controls and packaging of the compiled code and resources can also be done.
  • · Handling Dependencies between Targets: An Ant Project describes the target and tasks associated with it and also handles dependencies between various targets and tasks.

9 comments:

  1. Thanks for your informative guide on SQL technology. As we all know, SQL is most used database tool and your article offer clear insight about the technology. Your blog is recommended for freshers and experienced ones looking for ideal blog to learn SQL technology.
    Java Training in Chennai

    ReplyDelete
    Replies
    1. Great Article android based projects

      Java Training in Chennai Project Center in Chennai Java Training in Chennai projects for cse The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

      Delete
  2. There are lots of information about hadoop have spread around the web, but this is a unique one according to me. The strategy you have updated here will make me to get to the next level in big data. Thanks for sharing this. Hadoop Training in Chennai | Big Data Training in Chennai

    ReplyDelete
  3. Pretty article! I found some useful information in your blog, it was awesome to read, thanks for sharing this great content to my vision, keep sharing.
    Regards,
    SAP course in chennai|SAP training|SAP Course in Chennai|sap training in Chennai

    ReplyDelete
  4. Everyone wants to get unique place in the IT industry’s for that you need to upgrade your skills, your blog helps me improvise my skill set to get good career, keep sharing your thoughts with us.
    Regards,
    sas training in Chennai|sas course in Chennai|sas training institute in Chennai

    ReplyDelete
  5. I like the post format as you create user engagement in the complete article. It seems round up of all published posts. Thanks for gauging the informative posts.
    cara menggugurkan kandungan

    ReplyDelete