关于disconf不支持Spring5和SpringBoot2.0的问题解决

由于作者已经不再维护这个项目,所以有问题只能自己改源码来修复了。

改动点:
com.baidu.disconf.client.addons.properties.ReloadingPropertyPlaceholderConfigurer第97行:

// then, business as usual. no recursive reloading placeholders please.
return super.parseStringValue(buf.toString(), props, visitedPlaceholders);

改为:

// Fixed an issue with using obsolete api, which can't be started in spring5.
// then, business as usual. no recursive reloading placeholders please.PropertyPlaceholderHelper helper = new PropertyPlaceholderHelper(placeholderPrefix, placeholderSuffix, valueSeparator, ignoreUnresolvablePlaceholders);
return helper.replacePlaceholders(strVal, props);

GitHub地址:https://github.com/cjbi/disconf

原创文章 45 获赞 151 访问量 11万+

猜你喜欢

转载自blog.csdn.net/u010697681/article/details/82385392
今日推荐