Liquibase has property liquibase.hub.mode
(https://docs.liquibase.com/tools-integrations/liquibase-hub/commands.html). If I try to set it via application.properties
(using spring.liquibase.hub.mode=off
or spring.liquibase.hub-mode=off
), I get the following error message:
***************************
APPLICATION FAILED TO START
***************************
Description:
Binding to target [Bindable@58b34a34 type = org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties, value = 'provided', annotations = array<Annotation>[@org.springframework.boot.context.properties.ConfigurationProperties(ignoreInvalidFields=false, ignoreUnknownFields=false, prefix=spring.liquibase, value=spring.liquibase)]] failed:
Property: spring.liquibase.hub.mode
Value: off
Origin: class path resource [application.properties] - 18:27
Reason: The elements [spring.liquibase.hub.mode] were left unbound.
Action:
Update your application's configuration
Comment From: wilkinsona
Thanks for the suggestion. As far as I can tell, Liquibase doesn't provide an API for configuring Hub, unfortunately. We auto-configure a liquibase.integration.spring.SpringLiquibase
instance and there's no API on that class for configuring Hub. I think you may need to configure Hub using liquibase.properties
as described in the Liquibase docs. Perhaps I've missed something. Do you know how to configure the use of Hub programatically?
Comment From: tapioko
Ok. I guess I just assumed new Liquibase properties (I think it was introduced in Liquibase 4.0.0) must be whitelisted by Spring Boot, and no direct configuration is needed. So maybe I'll just try with liquibase.properties
then. Thanks!
Comment From: marcelstoer
Liquibase doesn't provide an API for configuring Hub, unfortunately
How about liquibase.configuration.LiquibaseConfiguration.getInstance().getConfiguration(HubConfiguration.class).setLiquibaseHubMode("OFF")
?
Comment From: wilkinsona
Thanks for the suggestion, @marcelstoer. Unfortunately, I'm not sure that meets our needs as it appears to have broader scope than our auto-configured SpringLiquibase
instance.
Comment From: voytech
From my recent experience this hub may cause troubles when you migrate to newer spring boot version and you have plenty of integration tests where migrations happen per each test method.
In my case just after bumping spring boot version (to version managing liquibase with hub) - tests execution time raised from 12 min to 1h 10 min . Btw at the same time junit4 was bumped to junit5 and spock to spock 2 and I was hoping a little performance improvement..
Finally i switched to the older version of liquibase and it takes 12 min again. (I need to figure it out how to turn off the hub on new version)
I think that many projects may have similar problems - it would be GREAT if this Hub is turned off by default somehow (I will try to investigate it too)
Comment From: marcelstoer
it appears to have broader scope than our auto-configured
SpringLiquibase
instance
That may be true, I didn't investigate. What's worse is that with 4.4 (a minor release!) they completely broke their configuration API - again.
Comment From: wilkinsona
@voytech Even if it was possible to turn Hub off via a configuration property, I don't think we would change Liquibase's defaults. If you're seeing a 6x increase in test execution time when moving to a newer version of Liquibase, I would report that to the Liquibase team as I would be surprised it it's intentional.