Skip to content

Service Configuration

Peter edited this page Mar 13, 2014 · 1 revision

Part of the goal of the application framework is to make it easier to automate the deployment of applications using configuration management tools like Puppet (and, in particular, to make configuration stick even when a redeploy is performed). To do this, default configurations are shipped with the webapp and overrides are read from the classpath via a layering of configuration files.

Resources

The framework asks Java for the following classpath resources. Values from these property files are merged together, with later results returned by the classloader overriding earlier results.

  • service.properties
  • environment.properties
  • services/(webapp name).properties

The service.properties file is generally confined to the shipping webapp, and contains default config values. The environment.properties file is generally where values such as the base path to the container (local.container.endpoint) are configured.

Configuration Files in Apache Tomcat

Functionally, the above resources translate to the following files in Apache Tomcat:

  • tomcat/lib/service.properties
  • tomcat/webapps/(webapp)/WEB-INF/classes/service.properties
  • tomcat/lib/environment.properties
  • tomcat/lib/services/(webapp name).properties