I have few properties in one property file which I want to inherit to application properties. Please let know if that is possible in spring boot.
something like
application.properties
----------------------
extends = otherproperty.properties
property1 = value1
property2= value2
property3 = value3
otherproperty.properties
------------------------
property4=value4
property5 = value5
When the spring boot app loads, I want all 5 properties should be loaded and available using @Value annotation. The spring boot automatically picks the application.properties in classpath and I don't have applicaitoncontext xml or any property loader code.
Thanks in advance.
I had the same question and found a good explained solution by mkyong. The tutorial explains how you can use different extending Spring profiles by using .porperties
or .yaml
files. (Same approach like eSala mentioned.)
https://www.mkyong.com/spring-boot/spring-boot-profile-based-properties-and-yaml-example/
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments