Hello All,
The below tutorial is for all learners who want to write a simple
ant build file.
first identify what you want to build, either .jar or .war . In my below tutorial I am putting down steps for creating a .war file using ant script.
build.xm-- for creating .war file.
create a build.xml file in eclipse and you can run build.xml file using eclipse as run as -- ant build.
But I dont suggest to depend on a tool , even though i like Eclipse . Try to down ant and set ant_home in the environment variables and run from the command prompt.
Now place below contents in the kdevaraBuild.properties . Before that create a file with what ever name you want and append .properties.
web.dir=WebContent
web.lib.dir=${web.dir}/WEB-INF/lib
build.classes.dir=build/classes
dist.dir=dist
project.name= AntTutorialKdevara
Now let me explain you the flow:
When ever we start a ant script create a default reference. In our above code in the default we mentioned "createWar"
and createWar has a dependency of "compileToClasses"
Organize your ant script clearly and the task can be done with out a problem.
This is one small example. You can read which tags to use and why in the ant tutorials available in the market.
If any developer need to finish the task of ant script immediately he/she can refer above piece of code and use it for reference.
Hope it is informative. you can also post any queries if you have.. i will try to respond to your queries to my best of knowledge
---Kamal----