DSpace/DSpace — pull request #40 by steveswinsburg (2012-07-10 07:05:06+00:00)
Title: DS-1208 Build time filtering to allow multi developer/environment builds

The addition of properly placeholders in dspace.cfg goes some of the way to allowing multiple developers/environments to use the same source tree, however not enough properties have been externalised.

For example,if I had 5 developers, how would I customise this property for each of them?
dspace.baseUrl = http://localhost:8080

In addition, the current setup requires the build to activate a maven profile, and supply properties either at build time or from a pom.xml, which are then hardcoded.

This isn't as flexible as it could be, for example by putting all configurable properties into a build.properties/filter.properties file and keeping that out of source control.
Then each developer simply customises the properties file with the values for their environment, and the build inserts the properties into the relevant source files at build time.

This is a standard maven filtering approach in use by many other projects. Note that any number of files can be filtered using this approach.

Using this approach, one simple copies build.properties.sample to build.properties, fills out the params and away they go. No other file needs to be modified. Not all properties have been externalised, just the ones that would typically differ between environments, e.g. dspace dir, server addresses, database, email etc. For more complex configuration that is unlikely to change between developer.build environments, the config still happens within the source code itself.

For properties that were externalised, their documentation was moved to build.properties. The rest has been left behind so that people can still be guided as to the configuration.

References:
http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html

Note that this pull request contains two single line commits from my previous pull request for DS-1209. Sorry about that. Please ignore those. I've been unable to remove them from the commit range here.