SlideShare una empresa de Scribd logo
1 de 8
6/6/13 ANT - Build Tool
file:///D:/codin/ant/ant01.html 1/8
Codin | Home | Previous | 01 | End
ANT - Build Tool
# ANT Example1:
HelloWorld.java
packageco.rakshit;
publicclassHelloWorld{
publicstaticvoidmain(String[]args){
System.out.println("WelcometoANT");
}
}
build.xml
<projectname="HelloWorld"default="run">
<targetname="compile">
<mkdirdir="co/rakshit"/>
<javacsrcdir="."destdir="."/>
<echo>Compilationisdone</echo>
</target>
<targetname="package"depends="compile">
<jardestfile="HelloWorld.jar"basedir="."
includes="co/rakshit/*.class"/>
</target>
<targetname="run"depends="package">
<javaclassname="co.rakshit.HelloWorld">
<classpath>
<pathelementlocation="."/>
</classpath>
</java>
<echo>Executionisdone</echo>
</target>
</project>
Download this example
Download .jar files
6/6/13 ANT - Build Tool
file:///D:/codin/ant/ant01.html 2/8
# ANT Example2:
Note: use the HelloWorld.java from previous example
build.xml
<projectname="HelloWorld"default="run">
<propertyname="classes.dir"value="build/classes"/>
<propertyname="target.dir"value="target"/>
<propertyname="project.name"value="HelloWorld"/>
<targetname="clean">
<deletedir="${classes.dir}"/>
<deletedir="${target.dir}"/>
</target>
<targetname="init"depends="clean">
<mkdirdir="${classes.dir}"/>
<mkdirdir="${target.dir}"/>
</target>
<targetname="compile"depends="init">
<mkdirdir="${classes.dir}/co/rakshit"/>
<javacsrcdir="src"destdir="${classes.dir}"/>
<echo>Compilationisdone</echo>
</target>
<targetname="package"depends="compile">
<jardestfile="${target.dir}/${project.name}.jar"
basedir="${classes.dir}"/>
<echo>packageisdone</echo>
</target>
<targetname="run"depends="package">
<javaclassname="co.rakshit.HelloWorld">
<classpath>
<pathelement
location="${target.dir}/${project.name}.jar"/>
</classpath>
</java>
<echo>Executionisdone</echo>
</target>
</project>
Download this example
Download .jar files
6/6/13 ANT - Build Tool
file:///D:/codin/ant/ant01.html 3/8
# ANT Example3:
Note: use the HelloWorld.java from previous example
build.xml
<projectname="HelloWorld"default="run">
<propertyfile="build.properties"/>
<targetname="clean">
<deletedir="${classes.dir}"/>
<deletedir="${target.dir}"/>
</target>
<targetname="init"depends="clean">
<mkdirdir="${classes.dir}"/>
<mkdirdir="${target.dir}"/>
</target>
<targetname="compile"depends="init">
<mkdirdir="${classes.dir}/co/rakshit"/>
<javacsrcdir="src"destdir="${classes.dir}"/>
<echo>Compilationisdone</echo>
</target>
<targetname="package"depends="compile">
<jardestfile="${target.dir}/${project.name}.jar"
basedir="${classes.dir}"/>
<echo>packageisdone</echo>
</target>
<targetname="run"depends="package">
<javaclassname="co.rakshit.HelloWorld">
<classpath>
<pathelement
location="${target.dir}/${project.name}.jar"/>
</classpath>
</java>
<echo>Executionisdone</echo>
</target>
</project>
build.properties
classes.dir=build/classes
target.dir=target
project.name=HelloWorld
6/6/13 ANT - Build Tool
file:///D:/codin/ant/ant01.html 4/8
Download this example
# ANT Example4:
Note: Before run below example, we need to copy servlet-api.jar file from tomcat
into our project "WEB-INFlib" folder.
build.xml
<projectname="WebANT"default="war">
<propertyfile="build.properties"/>
<!--defineclasspathjars-->
<pathid="compile.classpath">
<filesetdir="${web.lib.dir}">
<includename="*.jar"/>
</fileset>
</path>
<targetname="init"depends="clean">
<mkdirdir="${build.classes.dir}"/>
<mkdirdir="${dist.dir}"/>
</target>
<targetname="clean">
<deletedir="${build.classes.dir}"/>
<deletedir="${dist.dir}"/>
</target>
<targetname="compile"depends="init">
<javacsrcdir="src"destdir="${build.classes.dir}">
<classpathrefid="compile.classpath"/>
</javac>
<echo>Compilationisdone</echo>
</target>
<targetname="war"depends="compile">
<wardestfile="${dist.dir}/${project.name}.war"
webxml="${web.dir}/WEB-INF/web.xml">
<filesetdir="${web.dir}"/>
<libdir="${web.lib.dir}"/>
<classesdir="${build.classes.dir}"/>
</war>
<echo>packageisdone</echo>
</target>
6/6/13 ANT - Build Tool
file:///D:/codin/ant/ant01.html 5/8
</project>
build.properties
web.dir=WebContent
web.lib.dir=${web.dir}/WEB-INF/lib
build.classes.dir=builds/classes
dist.dir=dist
project.name=LoginApplication
HelloWorld.java
importjava.io.*;
importjavax.servlet.*;
publicclassHelloWorldextendsGenericServlet{
publicvoidservice(ServletRequestreq,ServletResponseres)throws
ServletException,IOException{
res.setContentType("text/html");
res.getWriter().print("<h1>HelloWorld</h1>");
}
}
web.xml
<web-app>
<servlet>
<servlet-name>hello</servlet-name>
<servlet-class>HelloWorld</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>hello</servlet-name>
<url-pattern>/hello</url-pattern>
</servlet-mapping>
</web-app>
Download this example
# ANT Example5:
6/6/13 ANT - Build Tool
file:///D:/codin/ant/ant01.html 6/8
Note: use HelloWorld.java, web.xml from previous example.
Note: Before run below example, we need to copy servlet-api.jar and catalina-ant.jar
files from tomcat into our project "WEB-INFlib" folder.
Step 1: Tomcat Authentication
-First add an user with adminstrator access right for Tomcat. To add Tomcat user, edit
this file - "%TOMCAT_PATH%/conf/tomcat-users.xml".
tomcat-users.xml
<?xmlversion='1.0'encoding='utf-8'?>
<tomcat-users>
<rolerolename="manager"/>
<rolerolename="admin"/>
<userusername="admin"password="password"
roles="admin,manager"/>
</tomcat-users>
build.xml
<projectname="LoginApplication"default="war">
<propertyfile="build.properties"/>
<!--defineclasspathjars-->
<pathid="compile.classpath">
<filesetdir="${web.lib.dir}">
<includename="*.jar"/>
</fileset>
</path>
<targetname="init"depends="clean">
<mkdirdir="${build.classes.dir}"/>
<mkdirdir="${dist.dir}"/>
</target>
<targetname="clean">
<deletedir="${build.classes.dir}"/>
<deletedir="${dist.dir}"/>
</target>
6/6/13 ANT - Build Tool
file:///D:/codin/ant/ant01.html 7/8
<targetname="compile"depends="init">
<javacsrcdir="src"destdir="${build.classes.dir}">
<classpathrefid="compile.classpath"/>
</javac>
<echo>Compilationisdone</echo>
</target>
<targetname="war"depends="compile">
<wardestfile="${dist.dir}/${project.name}.war"
webxml="${web.dir}/WEB-INF/web.xml">
<filesetdir="${web.dir}"/>
<libdir="${web.lib.dir}"/>
<classesdir="${build.classes.dir}"/>
</war>
<echo>packageisdone</echo>
</target>
<targetname="tomcat-start"depends="war">
<javajar="${tomcat.home}/bin/bootstrap.jar"fork="true">
<jvmargvalue="-Dcatalina.home=${tomcat.home}"/>
<argline="start"/>
</java>
</target>
<targetname="tomcat-stop">
<javajar="${tomcat.home}/bin/bootstrap.jar"fork="true">
<jvmargvalue="-Dcatalina.home=${tomcat.home}"/>
<argline="stop"/>
</java>
</target>
<targetname="deploy-tomcat"description="deploytotomcat"
depends="tomcat-start">
<echo>deployingfromclient</echo>
<deployurl="${tomcat-manager-url}"username="${tomcat-
manager-username}"password="${tomcat-manager-password}"
path="/${project.name}"war="file:./${dist.dir}/${project.name}.war"/>
<echo>Applicationsuccessfullydeployed</echo>
</target>
<targetname="undeploy"description="undeploying">
<echo>undeployingfromclient</echo>
<undeployurl="${tomcat-manager-url}"username="${tomcat-
manager-username}"password="${tomcat-manager-password}"
path="/${project.name}"/>
</target>
<taskdefname="start"classname="org.apache.catalina.ant.StartTask">
<classpath>
<pathelementlocation="${web.lib.dir}catalina-
ant.jar"/>
</classpath>
</taskdef>
<taskdefname="stop"classname="org.apache.catalina.ant.StopTask">
<classpath>
<pathelementlocation="${web.lib.dir}catalina-
ant.jar"/>
</classpath>
6/6/13 ANT - Build Tool
file:///D:/codin/ant/ant01.html 8/8
</taskdef>
<taskdefname="deploy"
classname="org.apache.catalina.ant.DeployTask">
<classpath>
<pathelementlocation="${web.lib.dir}catalina-
ant.jar"/>
</classpath>
</taskdef>
<taskdefname="undeploy"
classname="org.apache.catalina.ant.UndeployTask">
<classpath>
<pathelementlocation="${web.lib.dir}catalina-
ant.jar"/>
</classpath>
</taskdef>
</project>
build.properties
web.dir=WebContent
web.lib.dir=${web.dir}/WEB-INF/lib
build.classes.dir=builds/classes
dist.dir=dist
project.name=LoginApplication
tomcat.home=D:/dev/tomcat6
tomcat-manager-url=http://localhost:8080/manager
tomcat-manager-username=rohit
tomcat-manager-password=rohit
Download this example
Codin | Home | Previous | Index | End
© Rohit Rakshit

Más contenido relacionado

La actualidad más candente

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
 
Basic Tutorial of React for Programmers
Basic Tutorial of React for ProgrammersBasic Tutorial of React for Programmers
Basic Tutorial of React for ProgrammersDavid Rodenas
 
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 forCorneil du Plessis
 
Using and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareUsing and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareAlona Mekhovova
 
Android programming -_pushing_the_limits
Android programming -_pushing_the_limitsAndroid programming -_pushing_the_limits
Android programming -_pushing_the_limitsDroidcon Berlin
 
Reactive state management with Jetpack Components
Reactive state management with Jetpack ComponentsReactive state management with Jetpack Components
Reactive state management with Jetpack ComponentsGabor Varadi
 
Getting Started with React v16
Getting Started with React v16Getting Started with React v16
Getting Started with React v16Benny Neugebauer
 
State management in android applications
State management in android applicationsState management in android applications
State management in android applicationsGabor Varadi
 
Jsp/Servlet
Jsp/ServletJsp/Servlet
Jsp/ServletSunil OS
 
High Performance Django
High Performance DjangoHigh Performance Django
High Performance DjangoDjangoCon2008
 
Make use of Sonar for your mobile developments - It's easy and useful!
Make use of Sonar for your mobile developments - It's easy and useful!Make use of Sonar for your mobile developments - It's easy and useful!
Make use of Sonar for your mobile developments - It's easy and useful!cyrilpicat
 
What’s new in Android JetPack
What’s new in Android JetPackWhat’s new in Android JetPack
What’s new in Android JetPackHassan Abid
 
Networking and Data Access with Eqela
Networking and Data Access with EqelaNetworking and Data Access with Eqela
Networking and Data Access with Eqelajobandesther
 
HTML5 JavaScript APIs
HTML5 JavaScript APIsHTML5 JavaScript APIs
HTML5 JavaScript APIsRemy Sharp
 

La actualidad más candente (20)

Play vs Rails
Play vs RailsPlay vs Rails
Play vs Rails
 
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
 
Basic Tutorial of React for Programmers
Basic Tutorial of React for ProgrammersBasic Tutorial of React for Programmers
Basic Tutorial of React for Programmers
 
Spring 4 - A&BP CC
Spring 4 - A&BP CCSpring 4 - A&BP CC
Spring 4 - A&BP CC
 
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
 
Using and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareUsing and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middleware
 
Dropwizard
DropwizardDropwizard
Dropwizard
 
Android programming -_pushing_the_limits
Android programming -_pushing_the_limitsAndroid programming -_pushing_the_limits
Android programming -_pushing_the_limits
 
Reactive state management with Jetpack Components
Reactive state management with Jetpack ComponentsReactive state management with Jetpack Components
Reactive state management with Jetpack Components
 
Flask – Python
Flask – PythonFlask – Python
Flask – Python
 
Getting Started with React v16
Getting Started with React v16Getting Started with React v16
Getting Started with React v16
 
State management in android applications
State management in android applicationsState management in android applications
State management in android applications
 
Paging Like A Pro
Paging Like A ProPaging Like A Pro
Paging Like A Pro
 
Jsp/Servlet
Jsp/ServletJsp/Servlet
Jsp/Servlet
 
High Performance Django
High Performance DjangoHigh Performance Django
High Performance Django
 
Lviv 2013 d7 vs d8
Lviv 2013   d7 vs d8Lviv 2013   d7 vs d8
Lviv 2013 d7 vs d8
 
Make use of Sonar for your mobile developments - It's easy and useful!
Make use of Sonar for your mobile developments - It's easy and useful!Make use of Sonar for your mobile developments - It's easy and useful!
Make use of Sonar for your mobile developments - It's easy and useful!
 
What’s new in Android JetPack
What’s new in Android JetPackWhat’s new in Android JetPack
What’s new in Android JetPack
 
Networking and Data Access with Eqela
Networking and Data Access with EqelaNetworking and Data Access with Eqela
Networking and Data Access with Eqela
 
HTML5 JavaScript APIs
HTML5 JavaScript APIsHTML5 JavaScript APIs
HTML5 JavaScript APIs
 

Destacado

Cloud computing
Cloud computingCloud computing
Cloud computingAli Bahu
 
EclipseMAT
EclipseMATEclipseMAT
EclipseMATAli Bahu
 
Introduction To Ant
Introduction To AntIntroduction To Ant
Introduction To AntRajesh Kumar
 
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 PracticesMaidul Islam
 
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
 
Apache Ant
Apache AntApache Ant
Apache AntAli Bahu
 
Apache ANT vs Apache Maven
Apache ANT vs Apache MavenApache ANT vs Apache Maven
Apache ANT vs Apache MavenMudit Gupta
 
Apache Ant
Apache AntApache Ant
Apache AntAli Bahu
 
LatJUG Java Build Tools
LatJUG Java Build ToolsLatJUG Java Build Tools
LatJUG Java Build ToolsDmitry Buzdin
 
[오픈소스컨설팅]애플리케이션 빌드 및_배포가이드_v1.0_20140211
[오픈소스컨설팅]애플리케이션 빌드 및_배포가이드_v1.0_20140211[오픈소스컨설팅]애플리케이션 빌드 및_배포가이드_v1.0_20140211
[오픈소스컨설팅]애플리케이션 빌드 및_배포가이드_v1.0_20140211Ji-Woong Choi
 
Java Build Tools
Java Build ToolsJava Build Tools
Java Build Tools­Avishek A
 
Introduction to Apache Ant
Introduction to Apache AntIntroduction to Apache Ant
Introduction to Apache AntShih-Hsiang Lin
 
Java Build Tool course in 2011
Java Build Tool course in 2011Java Build Tool course in 2011
Java Build Tool course in 2011Ching Yi Chan
 

Destacado (20)

Cloud computing
Cloud computingCloud computing
Cloud computing
 
Hadoop
HadoopHadoop
Hadoop
 
Subversion (SVN)
Subversion (SVN)Subversion (SVN)
Subversion (SVN)
 
EclipseMAT
EclipseMATEclipseMAT
EclipseMAT
 
Introduction To Ant
Introduction To AntIntroduction To Ant
Introduction To Ant
 
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
 
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...
 
Apache ANT
Apache ANTApache ANT
Apache ANT
 
Apache Ant
Apache AntApache Ant
Apache Ant
 
Apache Ant
Apache AntApache Ant
Apache Ant
 
ANT
ANTANT
ANT
 
Apache ANT vs Apache Maven
Apache ANT vs Apache MavenApache ANT vs Apache Maven
Apache ANT vs Apache Maven
 
Apache Ant
Apache AntApache Ant
Apache Ant
 
LatJUG Java Build Tools
LatJUG Java Build ToolsLatJUG Java Build Tools
LatJUG Java Build Tools
 
[오픈소스컨설팅]애플리케이션 빌드 및_배포가이드_v1.0_20140211
[오픈소스컨설팅]애플리케이션 빌드 및_배포가이드_v1.0_20140211[오픈소스컨설팅]애플리케이션 빌드 및_배포가이드_v1.0_20140211
[오픈소스컨설팅]애플리케이션 빌드 및_배포가이드_v1.0_20140211
 
Java Build Tools
Java Build ToolsJava Build Tools
Java Build Tools
 
Apache maven 2 overview
Apache maven 2 overviewApache maven 2 overview
Apache maven 2 overview
 
Introduction to Apache Ant
Introduction to Apache AntIntroduction to Apache Ant
Introduction to Apache Ant
 
Java Build Tool course in 2011
Java Build Tool course in 2011Java Build Tool course in 2011
Java Build Tool course in 2011
 

Similar a Ant build tool2

OSGi framework overview
OSGi framework overviewOSGi framework overview
OSGi framework overviewBalduran Chang
 
การเข ยนโปรแกรมต ดต_อฐานข_อม_ล
การเข ยนโปรแกรมต ดต_อฐานข_อม_ลการเข ยนโปรแกรมต ดต_อฐานข_อม_ล
การเข ยนโปรแกรมต ดต_อฐานข_อม_ลBongza Naruk
 
A re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbaiA re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbaiPraveen Puglia
 
A I R Presentation Dev Camp Feb 08
A I R  Presentation  Dev Camp  Feb 08A I R  Presentation  Dev Camp  Feb 08
A I R Presentation Dev Camp Feb 08Abdul Qabiz
 
Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01Tino Isnich
 
JavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオンJavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオンharuki ueno
 
IzPack at LyonJUG'11
IzPack at LyonJUG'11IzPack at LyonJUG'11
IzPack at LyonJUG'11julien.ponge
 
How Secure Are Docker Containers?
How Secure Are Docker Containers?How Secure Are Docker Containers?
How Secure Are Docker Containers?Ben Hall
 
In the Brain of Hans Dockter: Gradle
In the Brain of Hans Dockter: GradleIn the Brain of Hans Dockter: Gradle
In the Brain of Hans Dockter: GradleSkills Matter
 
Configuration Surgery with Augeas
Configuration Surgery with AugeasConfiguration Surgery with Augeas
Configuration Surgery with AugeasPuppet
 
Androidaop 170105090257
Androidaop 170105090257Androidaop 170105090257
Androidaop 170105090257newegg
 
Rails 3: Dashing to the Finish
Rails 3: Dashing to the FinishRails 3: Dashing to the Finish
Rails 3: Dashing to the FinishYehuda Katz
 
Automation Frame works Instruction Sheet
Automation Frame works Instruction SheetAutomation Frame works Instruction Sheet
Automation Frame works Instruction SheetvodQA
 

Similar a Ant build tool2 (20)

OSGi framework overview
OSGi framework overviewOSGi framework overview
OSGi framework overview
 
การเข ยนโปรแกรมต ดต_อฐานข_อม_ล
การเข ยนโปรแกรมต ดต_อฐานข_อม_ลการเข ยนโปรแกรมต ดต_อฐานข_อม_ล
การเข ยนโปรแกรมต ดต_อฐานข_อม_ล
 
Dart Workshop
Dart WorkshopDart Workshop
Dart Workshop
 
A re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbaiA re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbai
 
A I R Presentation Dev Camp Feb 08
A I R  Presentation  Dev Camp  Feb 08A I R  Presentation  Dev Camp  Feb 08
A I R Presentation Dev Camp Feb 08
 
Gradle Introduction
Gradle IntroductionGradle Introduction
Gradle Introduction
 
Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01
 
JavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオンJavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオン
 
Demystifying Maven
Demystifying MavenDemystifying Maven
Demystifying Maven
 
Apache Ant
Apache AntApache Ant
Apache Ant
 
Build Scripts
Build ScriptsBuild Scripts
Build Scripts
 
IzPack at LyonJUG'11
IzPack at LyonJUG'11IzPack at LyonJUG'11
IzPack at LyonJUG'11
 
Mini curso Android
Mini curso AndroidMini curso Android
Mini curso Android
 
How Secure Are Docker Containers?
How Secure Are Docker Containers?How Secure Are Docker Containers?
How Secure Are Docker Containers?
 
In the Brain of Hans Dockter: Gradle
In the Brain of Hans Dockter: GradleIn the Brain of Hans Dockter: Gradle
In the Brain of Hans Dockter: Gradle
 
Configuration Surgery with Augeas
Configuration Surgery with AugeasConfiguration Surgery with Augeas
Configuration Surgery with Augeas
 
Augeas @RMLL 2012
Augeas @RMLL 2012Augeas @RMLL 2012
Augeas @RMLL 2012
 
Androidaop 170105090257
Androidaop 170105090257Androidaop 170105090257
Androidaop 170105090257
 
Rails 3: Dashing to the Finish
Rails 3: Dashing to the FinishRails 3: Dashing to the Finish
Rails 3: Dashing to the Finish
 
Automation Frame works Instruction Sheet
Automation Frame works Instruction SheetAutomation Frame works Instruction Sheet
Automation Frame works Instruction Sheet
 

Último

Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 

Último (20)

Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 

Ant build tool2

  • 1. 6/6/13 ANT - Build Tool file:///D:/codin/ant/ant01.html 1/8 Codin | Home | Previous | 01 | End ANT - Build Tool # ANT Example1: HelloWorld.java packageco.rakshit; publicclassHelloWorld{ publicstaticvoidmain(String[]args){ System.out.println("WelcometoANT"); } } build.xml <projectname="HelloWorld"default="run"> <targetname="compile"> <mkdirdir="co/rakshit"/> <javacsrcdir="."destdir="."/> <echo>Compilationisdone</echo> </target> <targetname="package"depends="compile"> <jardestfile="HelloWorld.jar"basedir="." includes="co/rakshit/*.class"/> </target> <targetname="run"depends="package"> <javaclassname="co.rakshit.HelloWorld"> <classpath> <pathelementlocation="."/> </classpath> </java> <echo>Executionisdone</echo> </target> </project> Download this example Download .jar files
  • 2. 6/6/13 ANT - Build Tool file:///D:/codin/ant/ant01.html 2/8 # ANT Example2: Note: use the HelloWorld.java from previous example build.xml <projectname="HelloWorld"default="run"> <propertyname="classes.dir"value="build/classes"/> <propertyname="target.dir"value="target"/> <propertyname="project.name"value="HelloWorld"/> <targetname="clean"> <deletedir="${classes.dir}"/> <deletedir="${target.dir}"/> </target> <targetname="init"depends="clean"> <mkdirdir="${classes.dir}"/> <mkdirdir="${target.dir}"/> </target> <targetname="compile"depends="init"> <mkdirdir="${classes.dir}/co/rakshit"/> <javacsrcdir="src"destdir="${classes.dir}"/> <echo>Compilationisdone</echo> </target> <targetname="package"depends="compile"> <jardestfile="${target.dir}/${project.name}.jar" basedir="${classes.dir}"/> <echo>packageisdone</echo> </target> <targetname="run"depends="package"> <javaclassname="co.rakshit.HelloWorld"> <classpath> <pathelement location="${target.dir}/${project.name}.jar"/> </classpath> </java> <echo>Executionisdone</echo> </target> </project> Download this example Download .jar files
  • 3. 6/6/13 ANT - Build Tool file:///D:/codin/ant/ant01.html 3/8 # ANT Example3: Note: use the HelloWorld.java from previous example build.xml <projectname="HelloWorld"default="run"> <propertyfile="build.properties"/> <targetname="clean"> <deletedir="${classes.dir}"/> <deletedir="${target.dir}"/> </target> <targetname="init"depends="clean"> <mkdirdir="${classes.dir}"/> <mkdirdir="${target.dir}"/> </target> <targetname="compile"depends="init"> <mkdirdir="${classes.dir}/co/rakshit"/> <javacsrcdir="src"destdir="${classes.dir}"/> <echo>Compilationisdone</echo> </target> <targetname="package"depends="compile"> <jardestfile="${target.dir}/${project.name}.jar" basedir="${classes.dir}"/> <echo>packageisdone</echo> </target> <targetname="run"depends="package"> <javaclassname="co.rakshit.HelloWorld"> <classpath> <pathelement location="${target.dir}/${project.name}.jar"/> </classpath> </java> <echo>Executionisdone</echo> </target> </project> build.properties classes.dir=build/classes target.dir=target project.name=HelloWorld
  • 4. 6/6/13 ANT - Build Tool file:///D:/codin/ant/ant01.html 4/8 Download this example # ANT Example4: Note: Before run below example, we need to copy servlet-api.jar file from tomcat into our project "WEB-INFlib" folder. build.xml <projectname="WebANT"default="war"> <propertyfile="build.properties"/> <!--defineclasspathjars--> <pathid="compile.classpath"> <filesetdir="${web.lib.dir}"> <includename="*.jar"/> </fileset> </path> <targetname="init"depends="clean"> <mkdirdir="${build.classes.dir}"/> <mkdirdir="${dist.dir}"/> </target> <targetname="clean"> <deletedir="${build.classes.dir}"/> <deletedir="${dist.dir}"/> </target> <targetname="compile"depends="init"> <javacsrcdir="src"destdir="${build.classes.dir}"> <classpathrefid="compile.classpath"/> </javac> <echo>Compilationisdone</echo> </target> <targetname="war"depends="compile"> <wardestfile="${dist.dir}/${project.name}.war" webxml="${web.dir}/WEB-INF/web.xml"> <filesetdir="${web.dir}"/> <libdir="${web.lib.dir}"/> <classesdir="${build.classes.dir}"/> </war> <echo>packageisdone</echo> </target>
  • 5. 6/6/13 ANT - Build Tool file:///D:/codin/ant/ant01.html 5/8 </project> build.properties web.dir=WebContent web.lib.dir=${web.dir}/WEB-INF/lib build.classes.dir=builds/classes dist.dir=dist project.name=LoginApplication HelloWorld.java importjava.io.*; importjavax.servlet.*; publicclassHelloWorldextendsGenericServlet{ publicvoidservice(ServletRequestreq,ServletResponseres)throws ServletException,IOException{ res.setContentType("text/html"); res.getWriter().print("<h1>HelloWorld</h1>"); } } web.xml <web-app> <servlet> <servlet-name>hello</servlet-name> <servlet-class>HelloWorld</servlet-class> </servlet> <servlet-mapping> <servlet-name>hello</servlet-name> <url-pattern>/hello</url-pattern> </servlet-mapping> </web-app> Download this example # ANT Example5:
  • 6. 6/6/13 ANT - Build Tool file:///D:/codin/ant/ant01.html 6/8 Note: use HelloWorld.java, web.xml from previous example. Note: Before run below example, we need to copy servlet-api.jar and catalina-ant.jar files from tomcat into our project "WEB-INFlib" folder. Step 1: Tomcat Authentication -First add an user with adminstrator access right for Tomcat. To add Tomcat user, edit this file - "%TOMCAT_PATH%/conf/tomcat-users.xml". tomcat-users.xml <?xmlversion='1.0'encoding='utf-8'?> <tomcat-users> <rolerolename="manager"/> <rolerolename="admin"/> <userusername="admin"password="password" roles="admin,manager"/> </tomcat-users> build.xml <projectname="LoginApplication"default="war"> <propertyfile="build.properties"/> <!--defineclasspathjars--> <pathid="compile.classpath"> <filesetdir="${web.lib.dir}"> <includename="*.jar"/> </fileset> </path> <targetname="init"depends="clean"> <mkdirdir="${build.classes.dir}"/> <mkdirdir="${dist.dir}"/> </target> <targetname="clean"> <deletedir="${build.classes.dir}"/> <deletedir="${dist.dir}"/> </target>
  • 7. 6/6/13 ANT - Build Tool file:///D:/codin/ant/ant01.html 7/8 <targetname="compile"depends="init"> <javacsrcdir="src"destdir="${build.classes.dir}"> <classpathrefid="compile.classpath"/> </javac> <echo>Compilationisdone</echo> </target> <targetname="war"depends="compile"> <wardestfile="${dist.dir}/${project.name}.war" webxml="${web.dir}/WEB-INF/web.xml"> <filesetdir="${web.dir}"/> <libdir="${web.lib.dir}"/> <classesdir="${build.classes.dir}"/> </war> <echo>packageisdone</echo> </target> <targetname="tomcat-start"depends="war"> <javajar="${tomcat.home}/bin/bootstrap.jar"fork="true"> <jvmargvalue="-Dcatalina.home=${tomcat.home}"/> <argline="start"/> </java> </target> <targetname="tomcat-stop"> <javajar="${tomcat.home}/bin/bootstrap.jar"fork="true"> <jvmargvalue="-Dcatalina.home=${tomcat.home}"/> <argline="stop"/> </java> </target> <targetname="deploy-tomcat"description="deploytotomcat" depends="tomcat-start"> <echo>deployingfromclient</echo> <deployurl="${tomcat-manager-url}"username="${tomcat- manager-username}"password="${tomcat-manager-password}" path="/${project.name}"war="file:./${dist.dir}/${project.name}.war"/> <echo>Applicationsuccessfullydeployed</echo> </target> <targetname="undeploy"description="undeploying"> <echo>undeployingfromclient</echo> <undeployurl="${tomcat-manager-url}"username="${tomcat- manager-username}"password="${tomcat-manager-password}" path="/${project.name}"/> </target> <taskdefname="start"classname="org.apache.catalina.ant.StartTask"> <classpath> <pathelementlocation="${web.lib.dir}catalina- ant.jar"/> </classpath> </taskdef> <taskdefname="stop"classname="org.apache.catalina.ant.StopTask"> <classpath> <pathelementlocation="${web.lib.dir}catalina- ant.jar"/> </classpath>
  • 8. 6/6/13 ANT - Build Tool file:///D:/codin/ant/ant01.html 8/8 </taskdef> <taskdefname="deploy" classname="org.apache.catalina.ant.DeployTask"> <classpath> <pathelementlocation="${web.lib.dir}catalina- ant.jar"/> </classpath> </taskdef> <taskdefname="undeploy" classname="org.apache.catalina.ant.UndeployTask"> <classpath> <pathelementlocation="${web.lib.dir}catalina- ant.jar"/> </classpath> </taskdef> </project> build.properties web.dir=WebContent web.lib.dir=${web.dir}/WEB-INF/lib build.classes.dir=builds/classes dist.dir=dist project.name=LoginApplication tomcat.home=D:/dev/tomcat6 tomcat-manager-url=http://localhost:8080/manager tomcat-manager-username=rohit tomcat-manager-password=rohit Download this example Codin | Home | Previous | Index | End © Rohit Rakshit