• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Simple Build Ant Script

 
Greenhorn
Posts: 1
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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----
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic