This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Simple Build Ant Script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Simple Build Ant Script" Watch "Simple Build Ant Script" New topic
Author

Simple Build Ant Script

Kamal Nath
Greenhorn

Joined: Mar 16, 2011
Posts: 1

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----
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Simple Build Ant Script
 
Similar Threads
WAR file creation using Ant in Java Program
Class files generated in web-inf directory as well as in base directory
Building Seam projects in Eclipse
Struts2:NoClassDefFoundError for pdf parsing using itext
Ant+JUnit