Remove hardcoded versions from MavenBuild

Use the dependencies BOM to ensure versions used in the `MavenBuild`
test class are always aligned.

Closes gh-23936
This commit is contained in:
Phillip Webb
2021-02-01 16:20:55 -08:00
parent 939b5dfc26
commit 40c1748e3c
4 changed files with 124 additions and 33 deletions

View File

@@ -9,6 +9,7 @@ plugins {
description = "Spring Boot Maven Plugin"
configurations {
dependenciesBom
documentation
}
@@ -16,6 +17,8 @@ dependencies {
compileOnly("org.apache.maven.plugin-tools:maven-plugin-annotations")
compileOnly("org.sonatype.plexus:plexus-build-api")
dependenciesBom(project(path: ":spring-boot-project:spring-boot-dependencies", configuration: "effectiveBom"))
implementation(project(":spring-boot-project:spring-boot-tools:spring-boot-buildpack-platform"))
implementation(project(":spring-boot-project:spring-boot-tools:spring-boot-loader-tools"))
implementation("org.apache.maven.shared:maven-common-artifact-filters")
@@ -41,12 +44,23 @@ dependencies {
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
task syncSpringBootDependenciesBom(type: Sync) {
destinationDir = file("${buildDir}/generated/sources/dependencies-bom/org/springframework/boot/maven")
from configurations.dependenciesBom
}
syncDocumentationSourceForAsciidoctor {
from(documentPluginGoals) {
into "asciidoc/goals"
}
}
sourceSets {
main {
output.dir("${buildDir}/generated/sources/dependencies-bom", builtBy: "syncSpringBootDependenciesBom")
}
}
tasks.withType(org.asciidoctor.gradle.jvm.AbstractAsciidoctorTask) {
doFirst {
def versionEl = version.split("\\.")