Referring https://jira.grails.org/browse/GRAILS-3620, we need to specify a class with static methods to decode the encrypted password in
passwordEncryptionCodec property, is it possible to refer to a bean defined in
resources.xml or any other grails bean definition files?
For ex: having a decrypted Properties bean in
resoures.xml or groovy, can I refer to this bean to pull the decrypted password? When I attempted doing this, bean resolution failed during grails startup.
Best How To :
I don't think this will be possible.
The reason for this is the lifecycle (startup) of a Spring/Grails application requires that the DataSource be parsed while setting up the Spring application context. As such, making reference to a bean in the application context isn't going to be valid because the application context hasn't finished being created.
The fact the JIRA issue indicates how to use static methods only underscores this since they have no requirement that the application context be fully initialized.