场景
需要对项目中密码进行加密处理,防止密码明文泄露,使用jasypt方式对密码进行加密。
现象
引入jar包,必须是starter包
<dependency>
<groupId></groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
</dependency>
修改密码为ENC(xxxxxx)
异常
Reason: Required Encryption configuration property missing:
Description:
Failed to bind properties under '' to :
Reason: Required Encryption configuration property missing:
Action:
Update your application's configuration
说明显示缺少配置,即Jasypt的加密密码。
正常情况这个密码是在运维或者DBA配置。
解决方案
在程序启动项或中增加--=xxxxx 即可。