Saturday, April 10, 2010

Java web application project directory structure

The directory structure I use for Java web projects is based on the Java Blueprints Guidelines recommended by SUN.

/webproject/ (the project root directory)
/webproject/build/ (this directory is packed into a WAR-file)
/webproject/test/ (system wide test files)
/webproject/setup/ (configuration files for container or project)
/webproject/dist/ (contains the WAR file)
/webproject/lib/ (libraries/jars)
/webproject/src/
/webproject/src/java/ (Java sources)
/webproject/src/conf/ (configuration files for build process)
/webproject/src/test/ (unit tests)
/webproject/docs/ (documentation)
/webproject/web/ (the web root starts here)
/webproject/web/WEB-INF/
/webproject/web/WEB-INF/jspf/*.jspf (JSP fragment/include files)
/webproject/web/WEB-INF/lib/
/webproject/web/WEB-INF/tlds/
/webproject/web/WEB-INF/tags/
/webproject/web/WEB-INF/faces-config.xml
/webproject/web/WEB-INF/web.xml
/webproject/web/*.jsp
/webproject/web/*.html
/webproject/web/css/ (CSS-files)
/webproject/web/img/ (images)
/webproject/web/js/ (JavaScript files)
/webproject/LICENSE.txt
/webproject/README.txt
/webproject/build.xml (ANT build file)

In the future, I'll post the ANT build file, which is used to automate build and package processes.

No comments:

Post a Comment