Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring boot - disable Liquibase at startup

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?

like image 204
Gravian Avatar asked Jun 08 '16 16:06

Gravian


People also ask

How do I turn off Liquibase in spring boot?

For Spring 5.liquibase. enabled=false application property disables Liquibase.

How do I disable Liquibase in Jhipster?

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.

How does Liquibase work with spring boot?

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).

Does Liquibase need Java?

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.


2 Answers

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

like image 72
Alex Shesterov Avatar answered Sep 17 '22 17:09

Alex Shesterov


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.

like image 33
Sangram Jadhav Avatar answered Sep 20 '22 17:09

Sangram Jadhav