What happens when spring-boot plugin is added to Gradle project? Why do we need to explicitly include spring.dependency-management plugin also.?
plugins {
id "org.springframework.boot" version "2.1.5.RELEASE"
id 'io.spring.dependency-management' version '1.0.8.RELEASE'
}
Since Gradle 5+ supports BOM files, you don't need the dependency-management plugin anymore. The spring boot plugin is still needed to provide tasks such as bootJar
and bootRun
. Here's a minimal build.gradle that should work:
buildscript {
ext {
springBootVersion = '2.2.4.RELEASE'
}
}
repositories {
mavenCentral()
}
plugins {
id 'java'
id 'org.springframework.boot' version "${springBootVersion}"
}
dependencies {
implementation platform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}")
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With