When using the agroal with spring-boot in combination with liquibase, one of the options of creating a SpringLiquibase bean is not working. Specifically when using a different username and password but not a different url by setting these in LiquibaseProperties, then the application will crash during initialization. The reason is that when using spring boot's LiquibaseAutoConfiguration it is possible to derive a DataSource from the provided DataSource and use different credentials to run liquibase.
This is done by getting the url from the provided (unwrapped) DataSource.
- In spring boot 2.x the provided DataSource is used, being AgroalDataSource (the one in the agroal-spring-boot-starter).
- From spring boot 3 the DataSource is unwrapped first, meaning that DataSource is being used (the implementation of AgroalDataSource from agroal-api).