Reputation: 1804
I want to load a properties file into Spring,but Spring cannot find the properties file with this XML.
The File is at /MyProject/MyModule/testData/testProperties.properties
The Test is at /MyProject/MyModule/src/test/MyTest.java
How to make Spring load from the correct path?
<bean id="properties" class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer">
<property name="locations">
<list>
<value>testData/testProperties.properties</value>
</list>
</property>
</bean>
Upvotes: 0
Views: 95
Reputation: 8758
You can try using file:
prefix
<value>file:/MyProject/MyModule/testData/testProperties.properties</value>
Upvotes: 1