Bill Comer
Bill Comer

Reputation: 1043

Spring's PropertyPlaceholderConfigurer with property in a jar file

I have multiple property files I need to refer to. Below I can refer to two that are on the classpath.

How do I refer to a property file with in a jar file ?

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

Upvotes: 4

Views: 4053

Answers (1)

skaffman
skaffman

Reputation: 403441

If the JAR is in the classpath, then you can reference the properties file inside just like any other resource. Just specify the location of the properties file within the JAR file.

Upvotes: 6

Related Questions