At present i am keeping the password [ unencrypted ] in a property file. This password get placed as is in the configuration xml using ant.
[ The configuration xml is for datasource, it is creating the object of dbcp.BasicDataSource ]
Now, is it possible that after the ant target the password is copied in encrypted form. Heard the Jasypt can do that! Till now i haven’t tried this. But, the problem doesn’t end here. BasicDataSource do not accept encrypted password. Is there any replacement for BasicDatasource.
FYI: I am using Spring, if that matters.
Create a new task by extending existing task
Copy( responsible for file-copy ). Create a new type by extendingFilterSet( responsible for filtering of tokens ).see the code here:-
How to create nested element for ant task?
build.xml
blah-blah.properties
configuration xml
After the execution of the target the xml is copied with values from properties file. Password will be encrypted.
This will handle the encrypted password.
EncryptionAwareDataSource
That’ all 😉