Skip to content

Commit 90e4421

Browse files
nanotaboadaclaude
andcommitted
fix(db): replace flyway-core with spring-boot-starter-flyway (#130)
Spring Boot 4.0 moved Flyway auto-configuration out of spring-boot-autoconfigure into a dedicated starter module. Adding only flyway-core to the classpath is no longer sufficient to trigger FlywayAutoConfiguration or the spring.flyway.* properties — the starter is required, following the same convention as spring-boot-starter-data-jpa, spring-boot-starter-webmvc, etc. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7500bba commit 90e4421

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ Release names follow the **historic football clubs** naming convention (A–Z):
4343
### Added
4444

4545
- Integrate Flyway for database schema versioning and automated migrations;
46-
add `flyway-core` and `flyway-database-postgresql` to `pom.xml`; create
46+
add `spring-boot-starter-flyway` (Spring Boot 4.0 requires this dedicated
47+
starter for autoconfiguration — `flyway-core` alone is insufficient) and
48+
`flyway-database-postgresql` to `pom.xml`; create
4749
migration directory `src/main/resources/db/migration/` with three versioned
4850
scripts: `V1__Create_players_table.sql` (schema), `V2__Seed_starting11.sql`
4951
(11 Starting XI players), `V3__Seed_substitutes.sql` (15 substitute players);

pom.xml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,16 +169,18 @@
169169
<groupId>org.hibernate.orm</groupId>
170170
<artifactId>hibernate-community-dialects</artifactId>
171171
</dependency>
172-
<!-- Flyway Core ================================================== -->
172+
<!-- Spring Boot Starter Flyway ==================================== -->
173173
<!--
174-
Flyway is an open-source database migration tool. It provides version
175-
control for your database schema and automates migrations across all
176-
environments. Includes built-in support for SQLite (community).
177-
https://mvnrepository.com/artifact/org.flywaydb/flyway-core
174+
Spring Boot 4.0 moved Flyway auto-configuration out of
175+
spring-boot-autoconfigure into this dedicated starter. Adding only
176+
flyway-core is no longer sufficient — this starter is required to
177+
enable FlywayAutoConfiguration and the spring.flyway.* properties.
178+
Transitively brings in flyway-core (version managed by Spring BOM).
179+
https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-flyway
178180
-->
179181
<dependency>
180-
<groupId>org.flywaydb</groupId>
181-
<artifactId>flyway-core</artifactId>
182+
<groupId>org.springframework.boot</groupId>
183+
<artifactId>spring-boot-starter-flyway</artifactId>
182184
</dependency>
183185
<!-- Flyway Database PostgreSQL ==================================== -->
184186
<!--

0 commit comments

Comments
 (0)