From 58f5955a38b89c7db424077c36bff386bb29a9b6 Mon Sep 17 00:00:00 2001 From: Janne Bergman Date: Tue, 10 Mar 2026 15:24:26 +0200 Subject: [PATCH] Fix Flyway autoconfigure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In Spring Boot 4.0, auto-configurations were extracted from the monolithic spring-boot-autoconfigure module into separate modules. Having flyway-core on the classpath is no longer enough — the Flyway auto-configuration class is now in a separate module that needs tp be included in the dependencies. --- development.sh | 7 +++++++ pom.xml | 4 ++-- .../auth/FlywayAutoConfigurationPresentTest.kt | 15 +++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 src/test/kotlin/fi/hsl/jore4/auth/FlywayAutoConfigurationPresentTest.kt diff --git a/development.sh b/development.sh index 5e9354b..eb79e8e 100755 --- a/development.sh +++ b/development.sh @@ -136,6 +136,9 @@ print_usage() { test Run tests locally. + run + Run the application locally. + stop Stop Docker containers. @@ -174,6 +177,10 @@ case $COMMAND in run_tests ;; + run) + mvn spring-boot:run -Pdev + ;; + stop) stop_all ;; diff --git a/pom.xml b/pom.xml index 1081600..8736e8c 100644 --- a/pom.xml +++ b/pom.xml @@ -370,8 +370,8 @@ postgresql - org.flywaydb - flyway-core + org.springframework.boot + spring-boot-starter-flyway org.flywaydb diff --git a/src/test/kotlin/fi/hsl/jore4/auth/FlywayAutoConfigurationPresentTest.kt b/src/test/kotlin/fi/hsl/jore4/auth/FlywayAutoConfigurationPresentTest.kt new file mode 100644 index 0000000..5c126a4 --- /dev/null +++ b/src/test/kotlin/fi/hsl/jore4/auth/FlywayAutoConfigurationPresentTest.kt @@ -0,0 +1,15 @@ +package fi.hsl.jore4.auth + +import org.junit.jupiter.api.Assertions.assertNotNull +import org.junit.jupiter.api.Tag +import org.junit.jupiter.api.Test + +@Tag("unitTest") +class FlywayAutoConfigurationPresentTest { + + @Test + fun `flyway auto-configuration class is on the classpath`() { + val clazz = Class.forName("org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration") + assertNotNull(clazz, "FlywayAutoConfiguration must be on the classpath via spring-boot-starter-flyway") + } +}