Easy environment-based configuration for Spring
Openutils Deployment utils
Openutils-deployment contains a few utility classes that allow switching between different configurations in an application.
Openutils-deployment works by embedding configurations for different environments in the final application, and by choosing the correct configuration at runtime dependending on:
- the server name
- the webapp name (for web projects)
You can find a spring propertyconfigurer and a log4j servlet listener that follow this pattern.
The following example is a configuration snippet for it.openutils.deployment.spring.EnvironmentPropertyConfigurer: The ${env} variable will be replaced at runtime with the name of the current server and any existing configuration file wil be loaded.
<bean id="environmentProperties" class="it.openutils.deployment.spring.EnvironmentPropertyConfigurer">
<property name="fileLocation"
value="WEB-INF/config/${env}/environment.properties,
WEB-INF/config/default/environment.properties,
classpath:environment-${env}.properties,
classpath:environment.properties" />
</bean>
Project info & quick links
-
Latest release: 2.2
License: Apache Software License, Version 2.0 - Download Sourceforge file download area
- Bugs and feature requests OpenmindLAB Jira
- Changelog See what's new in release 2.2
- Source code Subversion public url
- Javadocs Documentation for the release 2.2
- Maven The dependency snippet for your pom