ulisesbocchio / jasypt-spring-boot

Jasypt integration for Spring boot
MIT License
2.89k stars 518 forks source link

jasypt change bootstrap.yml active profile to default #255

Closed dragontree101 closed 3 years ago

dragontree101 commented 3 years ago

i use spring-boot 2.4.1 and spring-cloud 2020.0 and jasypt-spring-boot-starter 3.0.3

i set properties in bootstart.yml

spring:
  profiles:
    active: test

and i run application, i found active change to default when i use jasypt-spring-boot-starter

if i set

jasypt:
  encryptor:
    bootstrap: false

everything is ok

this is a bug ? or i need to change any jasypt properties?

because i use springProfile variable in logback-spring.xml and not find test profile logback-spring.xml

dragontree101 commented 3 years ago

add skip-property-sources properties is ok!

jasypt:
  encryptor:
    skip-property-sources: 'org.springframework.boot.env.OriginTrackedMapPropertySource'

i debug jasypt-spring-boot-starter, i found jasypt warpped all MapPropertySource, i config profile in bootstrap.yml use OriginTrackedMapPropertySource, so is skip OriginTrackedMapPropertySource , and my project can not get active profile

dngzs commented 3 years ago

怎么解决的,兄弟,我看你关了