spring-boot-gradle-plugin 是否随 spring-boot 版本移动?

Does spring-boot-gradle-plugin moves with the spring-boot version?

嗨,官方文档中给出了以下片段:

buildscript {
    ext {
        springBootVersion = '2.0.0.BUILD-SNAPSHOT'
    }
    repositories {
        mavenCentral()
        maven { url 'https://repo.spring.io/libs-snapshot' }
    }
    dependencies {
        classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
    }
    }

apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

如果我们使用 spring-boot-gradle-plugin,我们是否必须遵循这种做法,boot 和 boot-plugin 版本是否相同? 如果版本不一样会怎么样?

Spring Boot 构建插件(Gradle 和 Maven)始终遵循 Spring Boot 版本。是的,它们必须与您使用的 Spring 引导版本相匹配。