provided by: 
Originally published at Internet.comRecap
In the first part of this series, we established an Ant build file with the following targets: init, clean, compile, test, javadoc, webapp, and war. Now, we will examine the directory structure in which these tasks do their work.
The Directory Structure
The foundation of any build process is the project directory structure. A messy project directory, cluttered with files dropped willy nilly into whatever directory the "file save" dialog happened to open up with, leads to arcane and bug-prone build scripts. On the other hand, if you try to organize too compulsively, you can end up with a byzantine nest of sub-sub-subdirectories that make it tedious to find the files you're looking for.
Here, I sketch what I think is a good foundation or skeleton for a project directory structure that can scale to large teams using version control and multiple releases. Directory Structure: myproject/ project root directory (run all tools from here) build.xml Ant build file deploy-dev.sh script to deploy your app to your development server deploy-live.sh script to deploy your app to your production (live) server lib/ jar files required for build src/ Java source code for servlets and utilities web/ Web files (html, jsp, etc.) conf/ configuration files web-dev.xml Webapp config file for development server web-live.xml Webapp config file for production (live) server build/ files compiled/copied into here (this directory can be safely deleted) webapp/ the build destination for the web application WEB-INF/ conf/web.xml etc. will be copied into here during build classes/ class file root for servlets and utilities lib/ jar files required for running app (usually a subset of the ones in myproject/lib) test/ directory used by unit test classes to create test files; can be safely deleted after build ...
Read article at Internet.com site