I am having some troubles in order to specify the absolute path of some resources in the application.yml of my spring boot app.
Using relative path works ok, I place those files under src/main/resources/key with the following configuration:
public: encryption: key: keys\encrypt\public_enc_asn1.key decryption: key: keys\decrypt\public_dec_asn1.key private: decryption: key: keys\decrypt\private_dec_asn1.key
I am using windows. I put the same files under C:\test\ with the following configs in application.yml but they are not working:
public: encryption: key: C:\test\encrypt\public_enc_asn1.key decryption: key: C:\test\decrypt\public_dec_asn1.key private: decryption: key: C:\test\decrypt\private_dec_asn1.key
How can I specify a windows absolute path in application.yml? I also tried with ${user.home}
option but no luck.
The error is due to colon in your values (as in C:\test\...
). You need to surround your value with quotes:
public:
encryption:
key: 'C:\test\encrypt\public_enc_asn1.key'
decryption:
key: 'C:\test\decrypt\public_dec_asn1.key'
private:
decryption:
key: 'C:\test\decrypt\private_dec_asn1.key'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With