0

I am using Play framework 2.3 I have an external Play plugin that uses spring to talk to an LDAP server using Spring-Ldap.

At the moment I placed my configuration file to /conf fodlder called ldap.properties.

in developer mode this works well. Spring loads it's own context like this ->

<context-source
        url="${ldap.bind.url}"
        base="${ldap.bind.base}"
        username="${ldap.bind.username}"
        password="${ldap.bind.password}" />

<bean id="placeholderConfig"     class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
        <list>
            <value>classpath:ldap.properties</value>
        </list>
    </property>
    <property name="ignoreUnresolvablePlaceholders" value="true"/>
</bean>

and as you can tell I am using the ldap.properties from the classpath.

When I create a play distribution the ldap.properties file is copied to the jar file of the main project.

What parameters do I need to pass into Play to ignore the ldap.properties file in the JAR and use the one which is for the live server at a given location?

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Istvano
  • 992
  • 1
  • 12
  • 19

1 Answers1

0

You can set Spring to read the properties from a location specified via an environment variable at runtime. This way your local properties file will provide the default settings and the one on the server will override it.

Community
  • 1
  • 1
Nonos
  • 2,450
  • 2
  • 23
  • 34