java - How to override PropertySourcesPropertyResolver and add an additional property source to Externalized configuration -


is there way override spring boot's propertysourcespropertyresolver , extend externalize configuration adding additional property source?

what i'm trying add property source in current list, , able override property current mechanism. , extend propertysourcespropertyresolver, when spring mapping properties classes annotated @configurationproperties , requesting key, can check key 2 different prefixes.

for example, if have properties 2 different locations:

properties on location 1: data.user=username

properties on location 2: service.data.user=serviceusername

i want able override value of data.user value of service.data.user (if property exists).

from: http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/beans/factory/config/placeholderconfigurersupport.html#default_value_separator

example xml property default value:

 <property name="url" value="jdbc:${dbname:defaultdb}"/> 

however, there appear few people have been having problems multiple property placeholders, might want watch out for:

the other way provide default value data.user property , let people override necessary.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -