termux's recent timeline updates
termux

termux

V2EX member #500919, joined on 2020-07-27 09:43:04 +08:00
termux's recent replies
@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
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2671 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 11:19 · PVG 19:19 · LAX 04:19 · JFK 07:19
♥ Do have faith in what you're doing.