Skip to content

Commit

Permalink
Reconfigure BOM usage to use Spring Dependency Recommender plugin (#1918
Browse files Browse the repository at this point in the history
)

* Remove isCanBeResolved setting from build file

* Depenendecy lock after switching to use the Spring Dependency management gradle plugin for dependencyManagement.
  • Loading branch information
paulbakker committed May 24, 2024
1 parent ae02480 commit 8b8d9d6
Show file tree
Hide file tree
Showing 36 changed files with 52,580 additions and 41,726 deletions.
38 changes: 21 additions & 17 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ plugins {
id("nebula.dependency-recommender") version "11.0.0"

id("nebula.netflixoss") version "11.4.0"
id("io.spring.dependency-management") version "1.1.5"

id("org.jmailen.kotlinter") version "3.11.1"
id("me.champeau.jmh") version "0.7.2"
id("me.champeau.mrjar") version "0.1.1"
Expand Down Expand Up @@ -64,16 +66,7 @@ allprojects {
force("org.springframework.graphql:spring-graphql:1.2.6")
}
}

dependencyRecommendations {
mavenBom(mapOf("module" to "org.jetbrains.kotlin:kotlin-bom:${Versions.KOTLIN_VERSION}"))

mavenBom(mapOf("module" to "org.springframework.boot:spring-boot-dependencies:${springBootVersion}"))
mavenBom(mapOf("module" to "org.springframework.cloud:spring-cloud-dependencies:2023.0.+"))
mavenBom(mapOf("module" to "com.fasterxml.jackson:jackson-bom:2.15.+"))
}
}

val internalBomModules by extra(
listOf(
project(":graphql-dgs-platform"),
Expand All @@ -86,27 +79,38 @@ configure(subprojects.filterNot { it in internalBomModules }) {
apply {
plugin("java-library")
plugin("kotlin")
// plugin("kotlin-kapt")
plugin("org.jmailen.kotlinter")
plugin("me.champeau.jmh")
plugin("io.spring.dependency-management")
}

/**
* Remove once the following ticket is closed:
* Kotlin-JVM: runtimeOnlyDependenciesMetadata, implementationDependenciesMetadata should be marked with isCanBeResolved=false
* https://youtrack.jetbrains.com/issue/KT-34394
*/
tasks.named("generateLock") {
doFirst {
project.configurations.filter { it.name.contains("DependenciesMetadata") }.forEach {
it.isCanBeResolved = false
}
}
}
// tasks.named("generateLock") {
// doFirst {
// project.configurations.filter { it.name.contains("DependenciesMetadata") }.forEach {
// it.isCanBeResolved = false
// }
// }
// }

val springBootVersion = extra["sb.version"] as String
val jmhVersion = "1.37"


dependencyManagement {
imports {
mavenBom("org.jetbrains.kotlin:kotlin-bom:${Versions.KOTLIN_VERSION}")

mavenBom("org.springframework.boot:spring-boot-dependencies:${springBootVersion}")
mavenBom("org.springframework.cloud:spring-cloud-dependencies:2023.0.+")
mavenBom("com.fasterxml.jackson:jackson-bom:2.15.+")
}
}

dependencies {
// Apply the BOM to applicable subprojects.
api(platform(project(":graphql-dgs-platform")))
Expand Down
Loading

0 comments on commit 8b8d9d6

Please sign in to comment.