This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

An Example of Ant use

 
Jawahar Rajan
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All,
I was recently trying to learn how to work with J2EE, using the demo/tutorila form the java.sun.com website. They had an example using the demo pet store,however they also asked to download the Ant files from the Apache website.
I did this and followed th einstructions on how toset up ANT to be used with the J2EE and or Tomcat server.
I am still a little confused as to the exact role of Ant.
1) does ant act like an extraction layer?
2) does Ant build XML files that read/write data?
Please could someone suggest some examples of Extreme Programming using J2EE and ANT
Thanks
Jawahar
 
Curt Combar
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ant is a tool, written in Java, that replicates and extends the functionality provided by the "make" tool on Unix. It is a tool for automating the build process for a Java project. The instructions for how to build a project are entered into an XML document (conventionally called "build.xml"). Ant reads this file and builds the project, checking dates of output files vs. their source files and only executing build steps for source files that have changed since the last build.
For example, say you have a J2EE project that includes several Java class files, dependant JAR files, web.xml, html/jsp files, EJBs and descriptor files. It is possible to build a single Ant build file in XML that tells Ant how to compile the Java, build the EJB Jar files and process them using a server-specific EJB tool to generate home and remote objects, package the html/jsp/image files into a WAR with the web.xml, and package the WAR and EJB jars into a single EAR file that can be deployed on your app server. The chief advantage of this is that you can change several source files and simply type "ant" to rebuild the entire EAR file. This saves a lot of time and mistakes!
There are several good FAQs, articles and examples in the Resources section at the Ant site: http://jakarta.apache.org/ant/resources.html
Curt
 
timothy zimmerman
Ranch Hand
Posts: 149
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Curt pretty much summed it up. Ant is simply a build tool. It has many built in functions to execute tasks typically performed in the build process ( mkdir, copy, delete ) as well as functions specific to building java applications (javac, jar).
To use it you script theses tasks in an xml file and then ant parses and executes the tasks.
There is another topic here you might find useful:
Ant Tutorial:
http://www.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=58&t=000043
 
timothy zimmerman
Ranch Hand
Posts: 149
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following link to an article on O'Reilly's site was posted in the Ant Tutorial thread by Matt Rasking
http://www.onjava.com/pub/a/onjava/2001/02/22/open_source.html
I just got the chance to read through it and it seems like it may be helpful.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic