admin管理员组

文章数量:1122846

I'm working on a Spring Boot project using Gradle and Kotlin DSL. I want to ensure that the Flyway plugin version I use is compatible with the version specified in the Spring Boot BOM. However, I'm running into issues where the plugin isn't found or managed correctly.

Here's my current build.gradle.kts setup:

plugins {
    kotlin("plugin.spring")
    id("org.springframework.boot") version "3.4.0"
    id("io.spring.dependency-management") version "1.1.6"
    id("org.flywaydb.flyway") version "10.22.0"
}

repositories {
    mavenCentral()
    gradlePluginPortal()
}

dependencies {
    // other dependencies
}

Problem:

The Flyway plugin version isn't being managed by the Spring Boot BOM, and I have to specify the version explicitly in the plugins block. This leads to potential compatibility issues, and I want to avoid manual version management. For instance our Renovate Bot always updates to the newest version and the included FlyWay version within Spring Boot 3.4.0 is 10.22.0, however the plugins newest version is 11.0.0 which got included this night. I also tried leaving the version blank or use a dynamic version but in that case Gradle is not able to resolve any plugin version or uses the newest one.

Question:

  1. Is there a way to automatically set the Flyway plugin version to the one supported by the Spring Boot BOM?
  2. How can I ensure that my Gradle plugins are compatible with the Spring Boot version I'm using?

Any guidance or best practices would be greatly appreciated!

本文标签: kotlinHow to Use Spring Boot BOM to Manage Flyway Plugin Version in GradleStack Overflow