Spring boot - disable Liquibase at startup

Gravian picture Gravian · Jun 8, 2016 · Viewed 42.2k times · Source

I want to have Liquibase configured with my spring boot aplication, so I added dependencies to pom.xml and set the path to master.xml in application.properties. This works fine and Spring runs Liquibase at startup. The problem is that now I want to run Liquibase manually, not at startup of application. Should I completly disable Liquibase autoconfiguration or can i use it and only disable running evaluations at startup ?

Answer

Alex Shesterov picture Alex Shesterov · Mar 26, 2018

The relevant property name has changed between Spring versions:

  • For Spring 4.x.x: the liquibase.enabled=false application property disables Liquibase.

  • For Spring 5.x.x: the spring.liquibase.enabled=false application property disables Liquibase.


P.S. And for Flyway:

  • Spring 4.x.x: flyway.enabled=false

  • Spring 5.x.x: spring.flyway.enabled=false