Menu

#40 Spring 4 @PropertySource not being decrypted

v1.9.x
open
nobody
None
5
2015-05-14
2015-05-14
Dr Harp
No

I have been unable to get jasypt to work with Spring 4 and decrypt property files specified from the @PropertySource annotations, and accessing these via the @Value annotation.

Attached is a sample maven app with a junit test demonstrating the failure. Instead of decrypting the property, you get the raw string including the wrapping ENC()

if instead of specifying the config file via

@PropertySource("config.properties")

I include it in the creation of the PropertySourcesPlaceholderConfigurer with:

configurer.setLocation(new ClassPathResource("config.properties"));

Then everything works and the property is decrypted, but I would like to use the Spring annotations for specifying property files (especially for @Import 'ed configs who will not know to add them to the encrypted version)

1 Attachments

Discussion


Log in to post a comment.