简体   繁体   中英

Spring-boot liquibase integration

Although I raised issue https://github.com/spring-projects/spring-boot/issues/662 to provide a spring-boot-starter-liquibase-starter module, today I found out that there is already some kind of integration.

Spring Boot already contains https://github.com/spring-projects/spring-boot/tree/master/spring-boot/src/main/java/org/springframework/boot/liquibase with a Spring Boot Liquibase specific service locator. From this code and the Spring Boot reference guide I cannot figure out what Spring Boot is already offering.

However I also found out that when adding Gradle dependency "org.liquibase:liquibase-core" (note without version number) it automatically resolves liquibase 3.1.1 so the Spring Boot specific dependency resolver is doing some 'magic' here.

Anyone knows what kind of integration Spring Boot is offering in terms of Liquibase? I would like to automatically perform migrations (if needed) during startup of the application.

Spring Boot knows about Liquibase and detects it on the classpath (hence the magic dependency resolution). Liquibase has an SPI for creating its services that we implement in a special way so they work with the executable JAR format that Spring Boot supports. So, in short, if it's there and you add it to your context it will work (as mentioned briefly in the docs ). But there is no "autoconfiguration" out of the box (we can use your github issue to manage that if you want a new feature).

有关如何将 liquibase 与 Spring Boot 集成的更多信息,您可以查看教程集成 liquibase

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM