termux 最近的时间轴更新
termux

termux

V2EX 第 500919 号会员,加入于 2020-07-27 09:43:04 +08:00
termux 最近回复了
@zhongpingjing 啊不会吧,密码是配置的 ENC(xxx)吗,我之前整合 Jasypt 和 Nacos 的时候没啥问题- -
好像不管有没有设置 @Target(ElementType.RECORD_COMPONENT),都可以用反射获取属性上的所有注解:field.getAnnotations()
@zhongpingjing 感觉不用太高也不用太低,看 Jasypt 源码设置的是 Ordered.LOWEST_PRECEDENCE - 100 ,要不你试下看看,还不行的话就慢慢调整下这个值

https://github.com/ulisesbocchio/jasypt-spring-boot/blob/fc0ef8f1e77edfef4ee6494524d348e7aafbe39c/jasypt-spring-boot/src/main/java/com/ulisesbocchio/jasyptspringboot/configuration/EncryptablePropertySourceBeanFactoryPostProcessor.java#L169
如果猜测是顺序问题,可以调整一下 EnvironmentPostProcessor 的优先级(加 @Order 注解或者实现 org.springframework.core.Ordered 接口)


个人比较推荐使用现成的开源库,网上教程挺多的:
https://github.com/ulisesbocchio/jasypt-spring-boot
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4196 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 11ms · UTC 10:15 · PVG 18:15 · LAX 03:15 · JFK 06:15
Developed with CodeLauncher
♥ Do have faith in what you're doing.