Grails Multi-Environment Configuration Issues With DFC

780 views Asked by At

We have a Grails application that connects to a Documentum docbase using the dfc.jar and dctm.jar APIs. These jars expect a dfc.properties file to be on the classpath to configure the docbase settings. This is fine when working in one environment, but we are building war files for dev, test, and prod environments, each with their own dfc.properties configurations.

The Grails environment configuration works great for handling other environment specific settings within the app, but I can't figure out a way to either override the dfc.properties file on a per environment basis or configure the Documentum API to retrieve it's settings from someplace else.

I have considered having environment specific properties files and then running a shell script before each war build to copy them to the dfc.properties file, but that feels like too much of a hack. I would like to be able to just do three war builds without muddying it up copying different versions of properties files around.

 grails dev war
 grails test war
 grails prod war

Any suggestions on how to approach this multi-environment configuration issue would be greatly appreciated.

1

There are 1 answers

0
Tiksi On

Add this line to the top of your dfc.properties inside WEB-INF/classes and store the externalized version outside the application server:

#include D:\Documentum\config\dfc.properties

As long as you can externalize any other environmental configurations, you will only need one war.

As a bonus, you can still include application-specific keys in the WEB-INF version if you wanted to, and it would be merged with the external copy. This way, multiple applications can be configured separately, but with, say, the same docbroker/global registry settings.