Frage

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.

War es hilfreich?

Lösung

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top