I want to have Liquibase configured with my Spring Boot application, so I added dependencies to pom.xml
and set the path to master.xml
in application.properties
. This works fine and Spring Boot runs Liquibase at startup. The problem is that now I want to run Liquibase manually, not at startup of application. Should I completely disable auto-configuration for Liquibase or can I use it and only disable running evaluations at startup?
For Spring 5.liquibase. enabled=false application property disables Liquibase.
In order to disable Liquibase in Maven-based project, you need to edit pom. xml file and add the new profile in the profiles node. ... <profile> <id>no-liquibase</id> <properties> <profile.
The Liquibase Spring Boot integration ensures the application database is updated along with the application code by using Spring Boot auto-configuration and features. To use Liquibase and Spring Boot: Install Maven and add it to your path. Ensure you have Java Development Kit (JDK 8, 11, or 16).
If you install Liquibase manually, you must also install Java, which is available from Adoptium. If you use the Liquibase Installer, this version of Java is used during installation.
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
Add liquibase.enabled=false
in your application.properties file
Reference
But if you don't want to use liquibase from application anymore, remove liquibase starter altogether from pom.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With