At work I’ve been working with my coworkers on standardizing our build process. We are managing 20+ public sites, each consisting of several applications in different platforms. So the idea that I had developed was using war as any web application builds (and same could be said for jar for any non-web applications. After all, war/jar is just a formality and they are just nicely structured zip files.

So I’ve started building out what I ended up calling bundles - basically stock distribution of such php applications as wordpress, drupal, phpBB etc using the standard maven 2 suggested layout with a pom.xml in it.

Take Drupal as an example

- pom.xml
- src/main/webapp

drupal-directory

The pom.xml would look like this

<?xml version=”1.0″ encoding=”UTF-8″?>
<project
xmlns=”http://maven.apache.org/POM/4.0.0″
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=”http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd”>
<modelVersion>4.0.0</modelVersion>
<groupId>org.drupal.bundles</groupId>
<artifactId>drupal</artifactId>
<packaging>war</packaging>
<version>6.9</version>
</project>

Once this is installed on your maven2 repository, you create your own project using maven war overlay.

….
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<dependentWarIncludes>**/*</dependentWarIncludes>
<overlays>
<overlay>
<groupId>org.drupal.bundles</groupId>
<artifactId>drupal</artifactId>
<targetPath>drupal</targetPath>
</overlay>
</overlays>
</configuration>
</plugin>

<dependencies>
<dependency>
<groupId>org.drupal.bundles</groupId>
<artifactId>drupal</artifactId>
<version>6.9</version>
<type>war</type>
</dependency>
</dependencies>

Using this structure, you can put your own customization to the stock drupal code in your own maven2 project, while keeping the original source code in tact, hence giving you a easier way to manage base version upgrades etc.

Another added benefit to this is you can utilize zillions of maven2 plugins out there, including eclipse plugin to make your php app accessible in your eclipse. The most useful plugin is you can use Caucho’s resin plugin, allowing you to run your php application using quercus without needing any apache/php set up for your development environment.

A few pointers on setting up svn repository/project through dreamhost.
http://svnbook.red-bean.com/en/1.4/index.html
http://wiki.dreamhost.com/Subversion


mkdir tmpDir
cd tmpDir
mkdir -p project-name/branches project-name/tags project-name/trunk
svn import . file:///[REPO DIR] –message ‘Initial repository layout’

if using eclipse to do initial commit, don’t create trunk directory in the above step. subclipse requires to enter directory that does not already exist in the repository when initially sharing a team project.

if using maven based project with eclipse, run mvn clean before committing files so you can add svn:ignore props for target directory

Here’s a way to set up Guide for setting up subversion server on os x.

Probably using a hosting site such as dreamhost.com is better way to go.