Building with Ant: Introduction

Developing Web applications using Java Servlets, JavaServer Pages, and other J2EE technologies is fun! See how to avoid many of the common growing pains of application development by using simple tools, like Ant and JUnit, and a simple directory structure.

provided by: 
Originally published at Internet.com


Developing Web Applications using Java Servlets, JavaServer Pages, and other J2EE technologies is fun! However, the more interesting your application becomes, the more complicated your build process. In this article, I will sketch out a framework for how to use simple tools (like Ant and JUnit) and a simple directory structure to avoid many of the common growing pains of application development.

Conclusion



I hate articles that make you wade through mountains of verbosity before telling you what you need to know, so I'll summarize the main points of this article right up front: * Use Ant (duh). * Use a sensible directory. * Keep your build directory totally separate from your source directory. * Store all JAR files in a common lib directory, and copy or refer to them as needed. * Plan for multiple web.xml files (they may need to change if you want to deploy on more than one server). * Make an ant build target for Unit Testing, and use it as (or from) your default target.

Ant and Its Targets



Ant is a great open-source development tool from the Jakarta Project. If you haven't already, you should go download it from http://jakarta.apache.org/ant/, follow the install instructions for your platform, and look at the manual. I strongly recommend putting the ant executable on your PATH, so you can just run "ant" from the command line. Recent versions of ant make this as easy as setting a few environment variables...

Read article at Internet.com site
Related Articles
- Fun with Java: Sprite Animation, Part 5
Baldwin shows you how to override the update method of the Component class to improve the animation quality of the program over what would normally be achieved using the default version of the update method. In the process, he shows you how to eliminate the flashing that often accompanies efforts to use the default version of the update method for animation purposes. He also shows you how to get and use an offscreen drawing context to accomplish double buffering in the drawing process.
- Class of the Month: The Reflection API
- Fun with Java: Sprite Animation, Part 7
- A Peek at EJB 2, Part 3
- Java Advanced Placement Study Guide: Introduction to the Lessons, Primitive Types
- Data Structures in Java: Part 1, Getting Started
- Fun with Java: Sprite Animation, Part 6
- A Peek at EJB 2.0, Part 1
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1
- Data Structures in Java: Part 4, Purpose of Implementations and Algorithms
Regional Articles
- Building with Ant: Introduction Alabama
- Building with Ant: Introduction Alaska
- Building with Ant: Introduction Arizona
- Building with Ant: Introduction Arkansas
- Building with Ant: Introduction California
- Building with Ant: Introduction Colorado
- Building with Ant: Introduction Connecticut
- Building with Ant: Introduction DC
- Building with Ant: Introduction Delaware
- Building with Ant: Introduction Florida
- Building with Ant: Introduction Georgia
- Building with Ant: Introduction Hawaii
- Building with Ant: Introduction Idaho
- Building with Ant: Introduction Illinois
- Building with Ant: Introduction Indiana
- Building with Ant: Introduction Iowa
- Building with Ant: Introduction Kansas
- Building with Ant: Introduction Kentucky
- Building with Ant: Introduction Louisiana
- Building with Ant: Introduction Maine
- Building with Ant: Introduction Maryland
- Building with Ant: Introduction Massachusetts
- Building with Ant: Introduction Michigan
- Building with Ant: Introduction Minnesota
- Building with Ant: Introduction Mississippi
- Building with Ant: Introduction Missouri
- Building with Ant: Introduction Montana
- Building with Ant: Introduction Nebraska
- Building with Ant: Introduction Nevada
- Building with Ant: Introduction New Hampshire
- Building with Ant: Introduction New Jersey
- Building with Ant: Introduction New Mexico
- Building with Ant: Introduction New York
- Building with Ant: Introduction North Carolina
- Building with Ant: Introduction North Dakota
- Building with Ant: Introduction Ohio
- Building with Ant: Introduction Oklahoma
- Building with Ant: Introduction Oregon
- Building with Ant: Introduction Pennsylvania
- Building with Ant: Introduction Rhode Island
- Building with Ant: Introduction South Carolina
- Building with Ant: Introduction South Dakota
- Building with Ant: Introduction Tennessee
- Building with Ant: Introduction Texas
- Building with Ant: Introduction Utah
- Building with Ant: Introduction Vermont
- Building with Ant: Introduction Virginia
- Building with Ant: Introduction Washington
- Building with Ant: Introduction West Virginia
- Building with Ant: Introduction Wisconsin
- Building with Ant: Introduction Wyoming
Related Articles
- Fun with Java: Sprite Animation, Part 5
Baldwin shows you how to override the update method of the Component class to improve the animation quality of the program over what would normally be achieved using the default version of the update method. In the process, he shows you how to eliminate the flashing that often accompanies efforts to use the default version of the update method for animation purposes. He also shows you how to get and use an offscreen drawing context to accomplish double buffering in the drawing process.
- Class of the Month: The Reflection API
- Fun with Java: Sprite Animation, Part 7
- A Peek at EJB 2, Part 3
- Java Advanced Placement Study Guide: Introduction to the Lessons, Primitive Types
- Data Structures in Java: Part 1, Getting Started
- Fun with Java: Sprite Animation, Part 6
- A Peek at EJB 2.0, Part 1
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1
- Data Structures in Java: Part 4, Purpose of Implementations and Algorithms

Rss   Delicious   Digg   Add To My Yahoo   Add To My Google   Bookmark   Search Plugin

Topics:
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML