Version Control Repository Layouts

  • strict warning: Non-static method view::load() should not be called statically in /hermes/walnaweb12a/b57/moo.greydragoncom/nodsw/sites/all/modules/views/views.module on line 906.
  • strict warning: Declaration of views_handler_argument::init() should be compatible with views_handler::init(&$view, $options) in /hermes/walnaweb12a/b57/moo.greydragoncom/nodsw/sites/all/modules/views/handlers/views_handler_argument.inc on line 744.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /hermes/walnaweb12a/b57/moo.greydragoncom/nodsw/sites/all/modules/views/handlers/views_handler_filter.inc on line 607.
  • strict warning: Declaration of views_handler_filter::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /hermes/walnaweb12a/b57/moo.greydragoncom/nodsw/sites/all/modules/views/handlers/views_handler_filter.inc on line 607.
  • strict warning: Declaration of views_handler_filter_boolean_operator::value_validate() should be compatible with views_handler_filter::value_validate($form, &$form_state) in /hermes/walnaweb12a/b57/moo.greydragoncom/nodsw/sites/all/modules/views/handlers/views_handler_filter_boolean_operator.inc on line 159.
Leeland's picture

== Generic Expected Layout ==
Many shops adopt a source layout similar to this layout.

The root level is used as a dumping ground for all the code in the organization usually with the names broken into modules (if necessary) and each module has directories for build, distribution, source and test artifacts. The source and test directories are further subdivided by artifact type, in this case config, java, resources and sql.

* Module
*; src : Source artifacts related to the module
*; test : Test artifacts for the module
*; config : Module configuration
*; resources : Other source files.
*; sql : SQL scripts

== Jakarta Layout ==

Jakarta projects have adopted a common directory layout with the following elements:

* project root
*; bin : common binaries and scripts
*; build : location of build output
*; dist : location of distribution output
*; doc : project documentation
*; lib : various java libraries (e.g. junit, log4j, etc)
*; src : location of java source code

The bin, lib, doc and src directories would be under source control, build and dist are generated by the build tool. Other source content, like descriptors and jsp files would also be placed under the 'src' hierarchy. The focus being on keeping all source material together rather than mimicking the deployment hierarchy. Sub-projects would each have their own copy of the tree.

More information can be found at http://ant.apache.org/ant_in_anger.html.

== Sun Blueprint Layout ==

The Sun suggested guidelines are described at http://java.sun.com/blueprints/code/projectconventions.html . Their document is full of details - below are some of the interesting highlights:

; apps/ : Base directory for applications
; build/ : Created by build tool to hold build output
; components/ : Shared components used by more than one application
; conf/ : Configuration or other set-up files
; dist/ : Created by build tool to hold unzipped versions of the binary project artifacts
; docs/ : All project documentation
; lib/ : External libraries
; web/ : Static web content
; setup/ : Files used to configure the application environment, e.g. SQL scripts
; test/ : The top-level test directory contains project integration tests. Each individual component should also include unit tests under src/test

== Tuscany / SCA ==

Tuscany (http://incubator.apache.org/tuscany/index.html) is an Apache incubator project focused on building an SCA (http://www-128.ibm.com/developerworks/library/specification/ws-sca/) container. The current release contains sample SCA applications (download from http://incubator.apache.org/tuscany/download.html) which are mildly interesting since they provide a dual Ant/Maven build. Here's a sample application directory structure:

* Application
*; src : Project source files
*; main : Main application source files
*; test : Application test source files
*; java : Java class sources
*; resources : Metadata files
*; webapp : Web application archive files.

== Maven Layout ==

The standard Maven layout is considered an industry best practice now:

my-app
|-- pom.xml
`-- src
    |-- main
    |   |-- filters
    |   |   `-- filters.properties
    |   |-- java
    |   |   `-- com
    |   |       `-- mycompany
    |   |           `-- app
    |   |               `-- App.java
    |   `-- resources
    |       `-- META-INF
    |           `-- application.properties
    |-- site
    |   |-- apt
    |   |   |-- format.apt
    |   |   `-- index.apt
    |   |-- fml
    |   |   `-- faq.fml
    |   |-- fr
    |   |   |-- apt
    |   |   |   |-- format.apt
    |   |   |   `-- index.apt
    |   |   |-- fml
    |   |   |   `-- faq.fml
    |   |   `-- xdoc
    |   |       `-- xdoc.xml
    |   |-- site.xml
    |   |-- site_fr.xml
    |   `-- xdoc
    |       `-- xdoc.xml
    `-- test
        |-- java
        |   `-- com
        |       `-- mycompany
        |           `-- app
        |               `-- AppTest.java
        `-- resources
            `-- test.properties

This structure is described in the Maven Introduction to the Standard Directory Layout (http://maven.apache.org/guides/introduction/introduction-to-the-standard...):

; src/main/java : Application/Library sources
; src/main/resources : Application/Library sources
; src/main/filters : Resource filter files - used for property substitution at build time
; src/main/assembly : Assembly descriptors
; src/main/config : Configuration files
; src/main/webapp : Web application sources
; src/test/java : Test sources
; src/test/resources : Test resources
; src/test/filters : Test resource filter files
; src/site : Site - the Maven-built project website (details at http://maven.apache.org/guides/mini/guide-site.html).

Build output is placed in a target directory at the top level. Much like the Jakarta standard, if a project has multiple subprojects then each subproject would live in a directory under the main project with its own src directory.

Thread Slivers eBook at Amazon