SlideShare a Scribd company logo
ANT:ANT:
Another Nice ToolAnother Nice Tool
What is Ant?What is Ant?
 Java-based Build tool from ApacheJava-based Build tool from Apache
 De facto standard for building, packaging, andDe facto standard for building, packaging, and
installing Java applicationsinstalling Java applications
 Accomplishes same objectives thatAccomplishes same objectives that makemake does ondoes on
Unix based systemsUnix based systems
 Files are written in XMLFiles are written in XML
Why Ant?Why Ant?
 Unlike makefiles, Ant files work cross platformUnlike makefiles, Ant files work cross platform
- No need for multiple, complex makefiles- No need for multiple, complex makefiles
depending on the operating system.depending on the operating system.
- Tasks declared in platform independent way;- Tasks declared in platform independent way;
Ant engine translates to OS specific commands.Ant engine translates to OS specific commands.
 Easy to create own Ant “tasks”, in addition toEasy to create own Ant “tasks”, in addition to
core taskscore tasks
Installing AntInstalling Ant
 Download Ant binary distribution from:Download Ant binary distribution from:
http://ant.apache.org/bindownload.cgihttp://ant.apache.org/bindownload.cgi
 Set ANT_HOME to where you installed AntSet ANT_HOME to where you installed Ant
 Include $ANT_HOME/bin in PATHInclude $ANT_HOME/bin in PATH
 Make sure JAVA_HOME is set to point to JDKMake sure JAVA_HOME is set to point to JDK
Running AntRunning Ant
 TypeType “ant”“ant” at the command lineat the command line
 Automatically looks for build.xml file in currentAutomatically looks for build.xml file in current
directory to rundirectory to run
 TypeType “ant –buildfile“ant –buildfile buildfile.xmlbuildfile.xml”” to specifyto specify
another build file to run.another build file to run.
Ant OutputAnt Output
Sample build.xmlSample build.xml
<project name="MyProject" default="dist" basedir="."><project name="MyProject" default="dist" basedir=".">
<property name="src" location="src"/><property name="src" location="src"/>
<property name="build" location="build"/><property name="build" location="build"/>
<property name="dist" location="dist"/><property name="dist" location="dist"/>
<target name="init"><target name="init">
<tstamp/><tstamp/>
<mkdir dir="${build}"/><mkdir dir="${build}"/>
</target></target>
<target name="compile" depends="init" ><target name="compile" depends="init" >
<javac srcdir="${src}" destdir="${build}"/><javac srcdir="${src}" destdir="${build}"/>
</target></target>
<target name="dist" depends="compile" ><target name="dist" depends="compile" >
<mkdir dir="${dist}/lib"/><mkdir dir="${dist}/lib"/>
<jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/><jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/>
</target></target>
<target name="clean" ><target name="clean" >
<delete dir="${build}"/><delete dir="${build}"/>
<delete dir="${dist}"/><delete dir="${dist}"/>
</target></target>
</project></project>
Ant Overview: ProjectAnt Overview: Project
 Each build file contains exactly one project andEach build file contains exactly one project and
at least one targetat least one target
 Project tags specify the basic project attributesProject tags specify the basic project attributes
and have 3 properties:and have 3 properties:
- name- name
- default target- default target
- basedir- basedir
 Example: <project name=“MyProject” default=“build” basedir=“.”>Example: <project name=“MyProject” default=“build” basedir=“.”>
Ant Overview: TargetsAnt Overview: Targets
 Target is a build module in AntTarget is a build module in Ant
 Each target contains task(s) for Ant to doEach target contains task(s) for Ant to do
 One must be a project defaultOne must be a project default
 Overall structure of targets:Overall structure of targets:
<target name="A"/><target name="A"/>
<target name="B" depends="A"/><target name="B" depends="A"/>
<target name="C" depends="B"/><target name="C" depends="B"/>
<target name="D" depends="C,B,A"/><target name="D" depends="C,B,A"/>
Ant Overview: TasksAnt Overview: Tasks
 Each target comprises one or more tasksEach target comprises one or more tasks
 Task is a piece of executable Java code (e.g.Task is a piece of executable Java code (e.g.
javac, jar, etc)javac, jar, etc)
 Tasks do the actual “build” work in AntTasks do the actual “build” work in Ant
 Ant has core (built in) tasks and the ability toAnt has core (built in) tasks and the ability to
create own taskscreate own tasks
Ant Overview: TasksAnt Overview: Tasks
Example:Example:
<target name="prepare" depends="init“ ><target name="prepare" depends="init“ >
<mkdir dir="${build}" /><mkdir dir="${build}" />
</target></target>
<target name="build" depends="copy" ><target name="build" depends="copy" >
<javac srcdir="src" destdir="${build}"><javac srcdir="src" destdir="${build}">
<include name="**/*.java" /><include name="**/*.java" />
</javac></javac>
</target></target>
Ant Overview: Core TasksAnt Overview: Core Tasks
 javac – Runs the Java Compilerjavac – Runs the Java Compiler
 java – Runs the Java Virtual Machinejava – Runs the Java Virtual Machine
 jar (and war) – Create JAR filesjar (and war) – Create JAR files
 mkdir – Makes a directorymkdir – Makes a directory
 copy – Copies files to specified locationcopy – Copies files to specified location
 delete – Deletes specified filesdelete – Deletes specified files
 cvs – Invokes CVS commands from Antcvs – Invokes CVS commands from Ant
Ant Overview: Writing Own TaskAnt Overview: Writing Own Task
 Create a Java class that extendsCreate a Java class that extends org.apache.tools.ant.Taskorg.apache.tools.ant.Task
 For each attribute, write a setter method that isFor each attribute, write a setter method that is
public voidpublic void and takes a single argumentand takes a single argument
 Write aWrite a public void execute()public void execute() method, with nomethod, with no
arguments, that throws a BuildException -- thisarguments, that throws a BuildException -- this
method implements the task itselfmethod implements the task itself
Ant Overview: PropertiesAnt Overview: Properties
 Special task for setting up build file properties:Special task for setting up build file properties:
 Example:Example:
<property name=“src” value=“/home/src”/><property name=“src” value=“/home/src”/>
 Can use ${src} anywhere in build file toCan use ${src} anywhere in build file to
denote /home/srcdenote /home/src
 Ant provides access to all system properties as ifAnt provides access to all system properties as if
defined by thedefined by the <property><property> tasktask
Ant Overview: Path StructuresAnt Overview: Path Structures
 Ant provides means to set various environmentAnt provides means to set various environment
variables like PATH and CLASSPATH.variables like PATH and CLASSPATH.
 Example of setting CLASSPATH:Example of setting CLASSPATH:
<classpath><classpath>
<pathelement path="${classpath}"/><pathelement path="${classpath}"/>
<pathelement location="lib/helper.jar"/><pathelement location="lib/helper.jar"/>
</classpath></classpath>
Command Line ArgumentsCommand Line Arguments
 -buildfile-buildfile buildfilebuildfile – specify build file to use– specify build file to use
 targetnametargetname – specify target to run (instead of– specify target to run (instead of
running default)running default)
 -verbose, -quiet, -debug-verbose, -quiet, -debug – Allows control– Allows control
over the logging information Ant outputsover the logging information Ant outputs
 --loggerlogger classnameclassname – Allows user to specify– Allows user to specify
their own classes for logging Ant eventstheir own classes for logging Ant events
IDE IntegrationIDE Integration
 Eclipse, NetBeans, JBuilder, VisualAge, andEclipse, NetBeans, JBuilder, VisualAge, and
almost any other Java IDE has Ant integrationalmost any other Java IDE has Ant integration
built-in to the systembuilt-in to the system
 Refer to each IDE’s documentation for how toRefer to each IDE’s documentation for how to
use Ant with that IDEuse Ant with that IDE
Web Development with AntWeb Development with Ant
 Tomcat comes with special Ant tasks to easeTomcat comes with special Ant tasks to ease
Web application development and deploymentWeb application development and deployment
 CopyCopy $TOMCAT_HOME/server/lib/catalina-ant.jar$TOMCAT_HOME/server/lib/catalina-ant.jar toto
$ANT_HOME/lib$ANT_HOME/lib
 Ant tasks for Tomcat:Ant tasks for Tomcat:
- install- install
- reload- reload
- deploy- deploy
- remove- remove
Documentation/ReferencesDocumentation/References
 Download:Download: http://ant.apache.org/bindownload.cgihttp://ant.apache.org/bindownload.cgi
 User Manual:User Manual: http://ant.apache.org/manual/index.htmlhttp://ant.apache.org/manual/index.html

More Related Content

What's hot

Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot Introduction
Jeevesh Pandey
 
Play vs Rails
Play vs RailsPlay vs Rails
Play vs Rails
Daniel Cukier
 
Introduction To Django (Strange Loop 2011)
Introduction To Django (Strange Loop 2011)Introduction To Django (Strange Loop 2011)
Introduction To Django (Strange Loop 2011)Jacob Kaplan-Moss
 
PyCon US 2012 - State of WSGI 2
PyCon US 2012 - State of WSGI 2PyCon US 2012 - State of WSGI 2
PyCon US 2012 - State of WSGI 2Graham Dumpleton
 
Play!ng with scala
Play!ng with scalaPlay!ng with scala
Play!ng with scala
Siarzh Miadzvedzeu
 
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
Srijan Technologies
 
Djangocon 2014 - Django REST Framework - So Easy You Can Learn it in 25 Minutes
Djangocon 2014 - Django REST Framework - So Easy You Can Learn it in 25 MinutesDjangocon 2014 - Django REST Framework - So Easy You Can Learn it in 25 Minutes
Djangocon 2014 - Django REST Framework - So Easy You Can Learn it in 25 Minutes
Nina Zakharenko
 
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
Srijan Technologies
 
Gradle: The Build system you have been waiting for
Gradle: The Build system you have been waiting forGradle: The Build system you have been waiting for
Gradle: The Build system you have been waiting for
Corneil du Plessis
 
Building a real life application in node js
Building a real life application in node jsBuilding a real life application in node js
Building a real life application in node js
fakedarren
 
Immutable Deployments with AWS CloudFormation and AWS Lambda
Immutable Deployments with AWS CloudFormation and AWS LambdaImmutable Deployments with AWS CloudFormation and AWS Lambda
Immutable Deployments with AWS CloudFormation and AWS Lambda
AOE
 
Spring 4 - A&BP CC
Spring 4 - A&BP CCSpring 4 - A&BP CC
Spring 4 - A&BP CC
JWORKS powered by Ordina
 
Getting Into Drupal 8 Configuration
Getting Into Drupal 8 ConfigurationGetting Into Drupal 8 Configuration
Getting Into Drupal 8 Configuration
Philip Norton
 
Dropwizard
DropwizardDropwizard
Dropwizard
Scott Leberknight
 
Introducing Assetic: Asset Management for PHP 5.3
Introducing Assetic: Asset Management for PHP 5.3Introducing Assetic: Asset Management for PHP 5.3
Introducing Assetic: Asset Management for PHP 5.3
Kris Wallsmith
 
Dance for the puppet master: G6 Tech Talk
Dance for the puppet master: G6 Tech TalkDance for the puppet master: G6 Tech Talk
Dance for the puppet master: G6 Tech TalkMichael Peacock
 
Gradle - Build System
Gradle - Build SystemGradle - Build System
Gradle - Build System
Jeevesh Pandey
 
What happens in laravel 4 bootstraping
What happens in laravel 4 bootstrapingWhat happens in laravel 4 bootstraping
What happens in laravel 4 bootstraping
Jace Ju
 
Http4s, Doobie and Circe: The Functional Web Stack
Http4s, Doobie and Circe: The Functional Web StackHttp4s, Doobie and Circe: The Functional Web Stack
Http4s, Doobie and Circe: The Functional Web Stack
GaryCoady
 

What's hot (20)

Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot Introduction
 
Play vs Rails
Play vs RailsPlay vs Rails
Play vs Rails
 
Introduction To Django (Strange Loop 2011)
Introduction To Django (Strange Loop 2011)Introduction To Django (Strange Loop 2011)
Introduction To Django (Strange Loop 2011)
 
PyCon US 2012 - State of WSGI 2
PyCon US 2012 - State of WSGI 2PyCon US 2012 - State of WSGI 2
PyCon US 2012 - State of WSGI 2
 
CodeIgniter 3.0
CodeIgniter 3.0CodeIgniter 3.0
CodeIgniter 3.0
 
Play!ng with scala
Play!ng with scalaPlay!ng with scala
Play!ng with scala
 
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
 
Djangocon 2014 - Django REST Framework - So Easy You Can Learn it in 25 Minutes
Djangocon 2014 - Django REST Framework - So Easy You Can Learn it in 25 MinutesDjangocon 2014 - Django REST Framework - So Easy You Can Learn it in 25 Minutes
Djangocon 2014 - Django REST Framework - So Easy You Can Learn it in 25 Minutes
 
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
 
Gradle: The Build system you have been waiting for
Gradle: The Build system you have been waiting forGradle: The Build system you have been waiting for
Gradle: The Build system you have been waiting for
 
Building a real life application in node js
Building a real life application in node jsBuilding a real life application in node js
Building a real life application in node js
 
Immutable Deployments with AWS CloudFormation and AWS Lambda
Immutable Deployments with AWS CloudFormation and AWS LambdaImmutable Deployments with AWS CloudFormation and AWS Lambda
Immutable Deployments with AWS CloudFormation and AWS Lambda
 
Spring 4 - A&BP CC
Spring 4 - A&BP CCSpring 4 - A&BP CC
Spring 4 - A&BP CC
 
Getting Into Drupal 8 Configuration
Getting Into Drupal 8 ConfigurationGetting Into Drupal 8 Configuration
Getting Into Drupal 8 Configuration
 
Dropwizard
DropwizardDropwizard
Dropwizard
 
Introducing Assetic: Asset Management for PHP 5.3
Introducing Assetic: Asset Management for PHP 5.3Introducing Assetic: Asset Management for PHP 5.3
Introducing Assetic: Asset Management for PHP 5.3
 
Dance for the puppet master: G6 Tech Talk
Dance for the puppet master: G6 Tech TalkDance for the puppet master: G6 Tech Talk
Dance for the puppet master: G6 Tech Talk
 
Gradle - Build System
Gradle - Build SystemGradle - Build System
Gradle - Build System
 
What happens in laravel 4 bootstraping
What happens in laravel 4 bootstrapingWhat happens in laravel 4 bootstraping
What happens in laravel 4 bootstraping
 
Http4s, Doobie and Circe: The Functional Web Stack
Http4s, Doobie and Circe: The Functional Web StackHttp4s, Doobie and Circe: The Functional Web Stack
Http4s, Doobie and Circe: The Functional Web Stack
 

Viewers also liked

Version Control != Dependency Management
Version Control != Dependency ManagementVersion Control != Dependency Management
Version Control != Dependency Management
Patrick van Dissel
 
Maven
MavenMaven
Maven
feng lee
 
Java build tool_comparison
Java build tool_comparisonJava build tool_comparison
Java build tool_comparison
Manav Prasad
 
Cloud computing
Cloud computingCloud computing
Cloud computingAli Bahu
 
Ant build tool2
Ant   build tool2Ant   build tool2
Ant build tool2
Rohit Kumar
 
Introduction To Ant
Introduction To AntIntroduction To Ant
Introduction To Ant
Rajesh Kumar
 
EclipseMAT
EclipseMATEclipseMAT
EclipseMATAli Bahu
 
Subversion (SVN)
Subversion (SVN)Subversion (SVN)
Subversion (SVN)
manugoel2003
 
Ant - Another Neat Tool
Ant - Another Neat ToolAnt - Another Neat Tool
Ant - Another Neat ToolKanika2885
 
SVN Tool Information : Best Practices
SVN Tool Information  : Best PracticesSVN Tool Information  : Best Practices
SVN Tool Information : Best Practices
Maidul Islam
 
Apache ANT
Apache ANTApache ANT
Apache ANT
le.genie.logiciel
 
Highly efficient container orchestration and continuous delivery with DC/OS a...
Highly efficient container orchestration and continuous delivery with DC/OS a...Highly efficient container orchestration and continuous delivery with DC/OS a...
Highly efficient container orchestration and continuous delivery with DC/OS a...
Christian Bogeberg
 
Java Builds with Maven and Ant
Java Builds with Maven and AntJava Builds with Maven and Ant
Java Builds with Maven and Ant
David Noble
 
Apache Ant
Apache AntApache Ant
Apache AntAli Bahu
 
Apache Ant
Apache AntApache Ant
Apache AntAli Bahu
 

Viewers also liked (20)

Apache ant
Apache antApache ant
Apache ant
 
Maven Setup
Maven SetupMaven Setup
Maven Setup
 
Version Control != Dependency Management
Version Control != Dependency ManagementVersion Control != Dependency Management
Version Control != Dependency Management
 
Maven
MavenMaven
Maven
 
Java build tool_comparison
Java build tool_comparisonJava build tool_comparison
Java build tool_comparison
 
Hadoop
HadoopHadoop
Hadoop
 
Cloud computing
Cloud computingCloud computing
Cloud computing
 
Ant build tool2
Ant   build tool2Ant   build tool2
Ant build tool2
 
Introduction To Ant
Introduction To AntIntroduction To Ant
Introduction To Ant
 
EclipseMAT
EclipseMATEclipseMAT
EclipseMAT
 
Subversion (SVN)
Subversion (SVN)Subversion (SVN)
Subversion (SVN)
 
Ant - Another Neat Tool
Ant - Another Neat ToolAnt - Another Neat Tool
Ant - Another Neat Tool
 
SVN Tool Information : Best Practices
SVN Tool Information  : Best PracticesSVN Tool Information  : Best Practices
SVN Tool Information : Best Practices
 
Apache ANT
Apache ANTApache ANT
Apache ANT
 
Highly efficient container orchestration and continuous delivery with DC/OS a...
Highly efficient container orchestration and continuous delivery with DC/OS a...Highly efficient container orchestration and continuous delivery with DC/OS a...
Highly efficient container orchestration and continuous delivery with DC/OS a...
 
Java Builds with Maven and Ant
Java Builds with Maven and AntJava Builds with Maven and Ant
Java Builds with Maven and Ant
 
ANT
ANTANT
ANT
 
Apache Ant
Apache AntApache Ant
Apache Ant
 
Apache Ant
Apache AntApache Ant
Apache Ant
 
Apache Ant
Apache AntApache Ant
Apache Ant
 

Similar to Ant

Custom deployments with sbt-native-packager
Custom deployments with sbt-native-packagerCustom deployments with sbt-native-packager
Custom deployments with sbt-native-packager
GaryCoady
 
Build Scripts
Build ScriptsBuild Scripts
Write php deploy everywhere
Write php deploy everywhereWrite php deploy everywhere
Write php deploy everywhere
Michelangelo van Dam
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
Lindsay Holmwood
 
OSGi framework overview
OSGi framework overviewOSGi framework overview
OSGi framework overview
Balduran Chang
 
Introduction To Ant1
Introduction To  Ant1Introduction To  Ant1
Introduction To Ant1
Rajesh Kumar
 
Maven
MavenMaven
Maven
javeed_mhd
 
Maven
MavenMaven
Head First Zend Framework - Part 1 Project & Application
Head First Zend Framework - Part 1 Project & ApplicationHead First Zend Framework - Part 1 Project & Application
Head First Zend Framework - Part 1 Project & ApplicationJace Ju
 
DCSF19 Dockerfile Best Practices
DCSF19 Dockerfile Best PracticesDCSF19 Dockerfile Best Practices
DCSF19 Dockerfile Best Practices
Docker, Inc.
 
Phing
PhingPhing
Phing
mdekrijger
 
How to start using Scala
How to start using ScalaHow to start using Scala
How to start using ScalaNgoc Dao
 
Rally - Benchmarking_as_a_service - Openstack meetup
Rally - Benchmarking_as_a_service - Openstack meetupRally - Benchmarking_as_a_service - Openstack meetup
Rally - Benchmarking_as_a_service - Openstack meetupAnanth Padmanabhan
 
Demystifying Maven
Demystifying MavenDemystifying Maven
Demystifying Maven
Mike Desjardins
 
Introduction to JumpStart
Introduction to JumpStartIntroduction to JumpStart
Introduction to JumpStart
Scott McDermott
 
Does your configuration code smell?
Does your configuration code smell?Does your configuration code smell?
Does your configuration code smell?
Tushar Sharma
 
Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010
Tomek Kaczanowski
 
Maven in Mule
Maven in MuleMaven in Mule
Maven in Mule
Anand kalla
 

Similar to Ant (20)

Custom deployments with sbt-native-packager
Custom deployments with sbt-native-packagerCustom deployments with sbt-native-packager
Custom deployments with sbt-native-packager
 
Build Scripts
Build ScriptsBuild Scripts
Build Scripts
 
Write php deploy everywhere
Write php deploy everywhereWrite php deploy everywhere
Write php deploy everywhere
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
 
OSGi framework overview
OSGi framework overviewOSGi framework overview
OSGi framework overview
 
Introduction To Ant1
Introduction To  Ant1Introduction To  Ant1
Introduction To Ant1
 
Maven
MavenMaven
Maven
 
Maven
MavenMaven
Maven
 
Head First Zend Framework - Part 1 Project & Application
Head First Zend Framework - Part 1 Project & ApplicationHead First Zend Framework - Part 1 Project & Application
Head First Zend Framework - Part 1 Project & Application
 
DCSF19 Dockerfile Best Practices
DCSF19 Dockerfile Best PracticesDCSF19 Dockerfile Best Practices
DCSF19 Dockerfile Best Practices
 
Phing
PhingPhing
Phing
 
infra-as-code
infra-as-codeinfra-as-code
infra-as-code
 
How to start using Scala
How to start using ScalaHow to start using Scala
How to start using Scala
 
Rally - Benchmarking_as_a_service - Openstack meetup
Rally - Benchmarking_as_a_service - Openstack meetupRally - Benchmarking_as_a_service - Openstack meetup
Rally - Benchmarking_as_a_service - Openstack meetup
 
Demystifying Maven
Demystifying MavenDemystifying Maven
Demystifying Maven
 
Introduction to JumpStart
Introduction to JumpStartIntroduction to JumpStart
Introduction to JumpStart
 
Does your configuration code smell?
Does your configuration code smell?Does your configuration code smell?
Does your configuration code smell?
 
Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010
 
Write php deploy everywhere tek11
Write php deploy everywhere   tek11Write php deploy everywhere   tek11
Write php deploy everywhere tek11
 
Maven in Mule
Maven in MuleMaven in Mule
Maven in Mule
 

More from Manav Prasad

Experience with mulesoft
Experience with mulesoftExperience with mulesoft
Experience with mulesoft
Manav Prasad
 
Mulesoftconnectors
MulesoftconnectorsMulesoftconnectors
Mulesoftconnectors
Manav Prasad
 
Mule and web services
Mule and web servicesMule and web services
Mule and web services
Manav Prasad
 
Mulesoft cloudhub
Mulesoft cloudhubMulesoft cloudhub
Mulesoft cloudhub
Manav Prasad
 
Perl tutorial
Perl tutorialPerl tutorial
Perl tutorial
Manav Prasad
 
Hibernate presentation
Hibernate presentationHibernate presentation
Hibernate presentation
Manav Prasad
 
Spring introduction
Spring introductionSpring introduction
Spring introduction
Manav Prasad
 
Json
Json Json
The spring framework
The spring frameworkThe spring framework
The spring framework
Manav Prasad
 
Rest introduction
Rest introductionRest introduction
Rest introduction
Manav Prasad
 
Exceptions in java
Exceptions in javaExceptions in java
Exceptions in java
Manav Prasad
 
Junit
JunitJunit
Xml parsers
Xml parsersXml parsers
Xml parsers
Manav Prasad
 
Xpath
XpathXpath
Xhtml
XhtmlXhtml
Introduction to html5
Introduction to html5Introduction to html5
Introduction to html5
Manav Prasad
 

More from Manav Prasad (20)

Experience with mulesoft
Experience with mulesoftExperience with mulesoft
Experience with mulesoft
 
Mulesoftconnectors
MulesoftconnectorsMulesoftconnectors
Mulesoftconnectors
 
Mule and web services
Mule and web servicesMule and web services
Mule and web services
 
Mulesoft cloudhub
Mulesoft cloudhubMulesoft cloudhub
Mulesoft cloudhub
 
Perl tutorial
Perl tutorialPerl tutorial
Perl tutorial
 
Hibernate presentation
Hibernate presentationHibernate presentation
Hibernate presentation
 
Jpa
JpaJpa
Jpa
 
Spring introduction
Spring introductionSpring introduction
Spring introduction
 
Json
Json Json
Json
 
The spring framework
The spring frameworkThe spring framework
The spring framework
 
Rest introduction
Rest introductionRest introduction
Rest introduction
 
Exceptions in java
Exceptions in javaExceptions in java
Exceptions in java
 
Junit
JunitJunit
Junit
 
Xml parsers
Xml parsersXml parsers
Xml parsers
 
Xpath
XpathXpath
Xpath
 
Xslt
XsltXslt
Xslt
 
Xhtml
XhtmlXhtml
Xhtml
 
Css
CssCss
Css
 
Introduction to html5
Introduction to html5Introduction to html5
Introduction to html5
 
Ajax
AjaxAjax
Ajax
 

Recently uploaded

DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
Pixlogix Infotech
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 

Recently uploaded (20)

DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 

Ant

  • 2. What is Ant?What is Ant?  Java-based Build tool from ApacheJava-based Build tool from Apache  De facto standard for building, packaging, andDe facto standard for building, packaging, and installing Java applicationsinstalling Java applications  Accomplishes same objectives thatAccomplishes same objectives that makemake does ondoes on Unix based systemsUnix based systems  Files are written in XMLFiles are written in XML
  • 3. Why Ant?Why Ant?  Unlike makefiles, Ant files work cross platformUnlike makefiles, Ant files work cross platform - No need for multiple, complex makefiles- No need for multiple, complex makefiles depending on the operating system.depending on the operating system. - Tasks declared in platform independent way;- Tasks declared in platform independent way; Ant engine translates to OS specific commands.Ant engine translates to OS specific commands.  Easy to create own Ant “tasks”, in addition toEasy to create own Ant “tasks”, in addition to core taskscore tasks
  • 4. Installing AntInstalling Ant  Download Ant binary distribution from:Download Ant binary distribution from: http://ant.apache.org/bindownload.cgihttp://ant.apache.org/bindownload.cgi  Set ANT_HOME to where you installed AntSet ANT_HOME to where you installed Ant  Include $ANT_HOME/bin in PATHInclude $ANT_HOME/bin in PATH  Make sure JAVA_HOME is set to point to JDKMake sure JAVA_HOME is set to point to JDK
  • 5. Running AntRunning Ant  TypeType “ant”“ant” at the command lineat the command line  Automatically looks for build.xml file in currentAutomatically looks for build.xml file in current directory to rundirectory to run  TypeType “ant –buildfile“ant –buildfile buildfile.xmlbuildfile.xml”” to specifyto specify another build file to run.another build file to run.
  • 7. Sample build.xmlSample build.xml <project name="MyProject" default="dist" basedir="."><project name="MyProject" default="dist" basedir="."> <property name="src" location="src"/><property name="src" location="src"/> <property name="build" location="build"/><property name="build" location="build"/> <property name="dist" location="dist"/><property name="dist" location="dist"/> <target name="init"><target name="init"> <tstamp/><tstamp/> <mkdir dir="${build}"/><mkdir dir="${build}"/> </target></target> <target name="compile" depends="init" ><target name="compile" depends="init" > <javac srcdir="${src}" destdir="${build}"/><javac srcdir="${src}" destdir="${build}"/> </target></target> <target name="dist" depends="compile" ><target name="dist" depends="compile" > <mkdir dir="${dist}/lib"/><mkdir dir="${dist}/lib"/> <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/><jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/> </target></target> <target name="clean" ><target name="clean" > <delete dir="${build}"/><delete dir="${build}"/> <delete dir="${dist}"/><delete dir="${dist}"/> </target></target> </project></project>
  • 8. Ant Overview: ProjectAnt Overview: Project  Each build file contains exactly one project andEach build file contains exactly one project and at least one targetat least one target  Project tags specify the basic project attributesProject tags specify the basic project attributes and have 3 properties:and have 3 properties: - name- name - default target- default target - basedir- basedir  Example: <project name=“MyProject” default=“build” basedir=“.”>Example: <project name=“MyProject” default=“build” basedir=“.”>
  • 9. Ant Overview: TargetsAnt Overview: Targets  Target is a build module in AntTarget is a build module in Ant  Each target contains task(s) for Ant to doEach target contains task(s) for Ant to do  One must be a project defaultOne must be a project default  Overall structure of targets:Overall structure of targets: <target name="A"/><target name="A"/> <target name="B" depends="A"/><target name="B" depends="A"/> <target name="C" depends="B"/><target name="C" depends="B"/> <target name="D" depends="C,B,A"/><target name="D" depends="C,B,A"/>
  • 10. Ant Overview: TasksAnt Overview: Tasks  Each target comprises one or more tasksEach target comprises one or more tasks  Task is a piece of executable Java code (e.g.Task is a piece of executable Java code (e.g. javac, jar, etc)javac, jar, etc)  Tasks do the actual “build” work in AntTasks do the actual “build” work in Ant  Ant has core (built in) tasks and the ability toAnt has core (built in) tasks and the ability to create own taskscreate own tasks
  • 11. Ant Overview: TasksAnt Overview: Tasks Example:Example: <target name="prepare" depends="init“ ><target name="prepare" depends="init“ > <mkdir dir="${build}" /><mkdir dir="${build}" /> </target></target> <target name="build" depends="copy" ><target name="build" depends="copy" > <javac srcdir="src" destdir="${build}"><javac srcdir="src" destdir="${build}"> <include name="**/*.java" /><include name="**/*.java" /> </javac></javac> </target></target>
  • 12. Ant Overview: Core TasksAnt Overview: Core Tasks  javac – Runs the Java Compilerjavac – Runs the Java Compiler  java – Runs the Java Virtual Machinejava – Runs the Java Virtual Machine  jar (and war) – Create JAR filesjar (and war) – Create JAR files  mkdir – Makes a directorymkdir – Makes a directory  copy – Copies files to specified locationcopy – Copies files to specified location  delete – Deletes specified filesdelete – Deletes specified files  cvs – Invokes CVS commands from Antcvs – Invokes CVS commands from Ant
  • 13. Ant Overview: Writing Own TaskAnt Overview: Writing Own Task  Create a Java class that extendsCreate a Java class that extends org.apache.tools.ant.Taskorg.apache.tools.ant.Task  For each attribute, write a setter method that isFor each attribute, write a setter method that is public voidpublic void and takes a single argumentand takes a single argument  Write aWrite a public void execute()public void execute() method, with nomethod, with no arguments, that throws a BuildException -- thisarguments, that throws a BuildException -- this method implements the task itselfmethod implements the task itself
  • 14. Ant Overview: PropertiesAnt Overview: Properties  Special task for setting up build file properties:Special task for setting up build file properties:  Example:Example: <property name=“src” value=“/home/src”/><property name=“src” value=“/home/src”/>  Can use ${src} anywhere in build file toCan use ${src} anywhere in build file to denote /home/srcdenote /home/src  Ant provides access to all system properties as ifAnt provides access to all system properties as if defined by thedefined by the <property><property> tasktask
  • 15. Ant Overview: Path StructuresAnt Overview: Path Structures  Ant provides means to set various environmentAnt provides means to set various environment variables like PATH and CLASSPATH.variables like PATH and CLASSPATH.  Example of setting CLASSPATH:Example of setting CLASSPATH: <classpath><classpath> <pathelement path="${classpath}"/><pathelement path="${classpath}"/> <pathelement location="lib/helper.jar"/><pathelement location="lib/helper.jar"/> </classpath></classpath>
  • 16. Command Line ArgumentsCommand Line Arguments  -buildfile-buildfile buildfilebuildfile – specify build file to use– specify build file to use  targetnametargetname – specify target to run (instead of– specify target to run (instead of running default)running default)  -verbose, -quiet, -debug-verbose, -quiet, -debug – Allows control– Allows control over the logging information Ant outputsover the logging information Ant outputs  --loggerlogger classnameclassname – Allows user to specify– Allows user to specify their own classes for logging Ant eventstheir own classes for logging Ant events
  • 17. IDE IntegrationIDE Integration  Eclipse, NetBeans, JBuilder, VisualAge, andEclipse, NetBeans, JBuilder, VisualAge, and almost any other Java IDE has Ant integrationalmost any other Java IDE has Ant integration built-in to the systembuilt-in to the system  Refer to each IDE’s documentation for how toRefer to each IDE’s documentation for how to use Ant with that IDEuse Ant with that IDE
  • 18. Web Development with AntWeb Development with Ant  Tomcat comes with special Ant tasks to easeTomcat comes with special Ant tasks to ease Web application development and deploymentWeb application development and deployment  CopyCopy $TOMCAT_HOME/server/lib/catalina-ant.jar$TOMCAT_HOME/server/lib/catalina-ant.jar toto $ANT_HOME/lib$ANT_HOME/lib  Ant tasks for Tomcat:Ant tasks for Tomcat: - install- install - reload- reload - deploy- deploy - remove- remove
  • 19. Documentation/ReferencesDocumentation/References  Download:Download: http://ant.apache.org/bindownload.cgihttp://ant.apache.org/bindownload.cgi  User Manual:User Manual: http://ant.apache.org/manual/index.htmlhttp://ant.apache.org/manual/index.html