Eric
03/23/2022, 1:37 PMorg.springframework.boot:spring-boot-dependencies
(bom) to my bom I’m publishing so that only 1 line of
implementation(platform("com.example:common-bom:1.0-SNAPSHOT"))
is needed instead of needing both platforms like this:
implementation(platform("com.example:common-bom:1.0-SNAPSHOT"))
implementation(platform("org.springframework.boot:spring-boot-dependencies:2.5.10"))
Is there a doc showing how to do that?Eric
03/23/2022, 1:40 PMplatform/build.gradle.kts
looks like this:
plugins {
`java-platform`
`maven-publish`
id("com.jfrog.artifactory")
}
javaPlatform {
allowDependencies()
}
dependencies {
// keep kotlin, kotlin-reflect and all others in line using the kotlin bom
api(enforcedPlatform(kotlin("bom:1.5.32")))
// allow spring boot to dictate as many versions as possible
api(enforcedPlatform("org.springframework.boot:spring-boot-dependencies:2.5.10"))
constraints {
// subprojects
api(project(":common"))
api(project(":testing"))
api(project(":structured-kotlin-logging"))
api(project(":spring"))
api(project(":hibernate"))
platform("org.springframework.boot:spring-boot-dependencies:2.5.10")
}
}
publishing {
publications {
create<MavenPublication>("bom") {
groupId = "com.example"
artifactId = "common-bom"
version = project.parent?.version?.toString()
from(components["javaPlatform"])
}
}
}
artifactory.publish {
defaults {
publications("bom")
}
}
tasks.withType<GenerateModuleMetadata> {
suppressedValidationErrors.add("enforced-platform")
}
Eric
03/23/2022, 2:57 PM