考虑安全因素,配置文件中的数据库配置信息应该弄成密文的。刚好项目是SpringBoot,所以考虑jasypt 。
具体配置方案如下:
jasypt-spring-boot: 加密SpringBoot的敏感配置信息
但是我按照这个配置方案,启动的时候报了一个异常:
Caused by: java.io.FileNotFoundException: class path resource [com/ulisesbocchio/jasyptspringboot/configuration/EnableEncryptablePropertiesConfiguration.class] cannot be opened because it does not exist
去网上查问题也没有类似的答案。 后面看引用的jasypt-spring-boot-starter的jar里面,确实没有这个类,
查看gitHub上项目开源,