Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 448
Marcel Overdijk Avatar asked Apr 12 '14 17:04

Marcel Overdijk


1 Answers

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

like image 186
Dave Syer Avatar answered Oct 11 '22 13:10

Dave Syer