Skip to content

Commit be2a571

Browse files
authored
Use gradle's standard dependency management mechanism. (#802)
Intead of io.spring.dependency-management
1 parent 1438a93 commit be2a571

File tree

9 files changed

+37
-39
lines changed

9 files changed

+37
-39
lines changed

build.gradle.kts

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* under the License.
1515
*/
1616

17-
import com.github.spotbugs.snom.SpotBugsTask
1817
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
1918
import org.springframework.boot.gradle.plugin.SpringBootPlugin
2019

@@ -27,7 +26,6 @@ plugins {
2726
signing
2827
id("org.jetbrains.kotlin.jvm") version "1.7.10" apply false
2928
id("com.github.spotbugs") version "5.0.9" apply false
30-
id("io.spring.dependency-management") version "1.0.13.RELEASE" apply false
3129
id("org.springframework.boot") version "2.7.2" apply false
3230
id("io.freefair.lombok") version "6.5.0.3"
3331
}
@@ -55,7 +53,6 @@ subprojects {
5553
plugin("com.github.spotbugs")
5654
plugin("java-library")
5755
plugin("checkstyle")
58-
plugin("io.spring.dependency-management")
5956
plugin("io.freefair.lombok")
6057
}
6158

@@ -67,25 +64,9 @@ subprojects {
6764
group = rootProject.group
6865
version = rootProject.version
6966

70-
configure<io.spring.gradle.dependencymanagement.dsl.DependencyManagementExtension> {
71-
imports {
72-
mavenBom(SpringBootPlugin.BOM_COORDINATES)
73-
}
74-
75-
dependencies {
76-
dependency("com.google.guava:guava:31.1-jre")
77-
dependency("com.github.stefanbirkner:system-lambda:1.2.1")
78-
dependency("com.github.tomakehurst:wiremock-jre8:2.33.2")
79-
dependencySet("com.squareup.retrofit2:2.9.0") {
80-
entry("converter-jackson")
81-
entry("retrofit")
82-
}
83-
dependencySet("io.jsonwebtoken:0.11.5") {
84-
entry("jjwt-api")
85-
entry("jjwt-impl")
86-
entry("jjwt-jackson")
87-
}
88-
}
67+
dependencies {
68+
implementation(platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES))
69+
annotationProcessor(platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES))
8970
}
9071

9172
tasks.named("compileJava") {

gradle/libs.versions.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[versions]
2+
jsonwebtoken = "0.11.5"
3+
retrofit2 = "2.9.0"
4+
jjwt = "0.11.5"
5+
6+
[libraries]
7+
retrofit2-retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit2" }
8+
retrofit2-converter-jackson = { module = "com.squareup.retrofit2:converter-jackson", version.ref = "retrofit2" }
9+
guava = { group = "com.google.guava", name = "guava", version = "31.1-jre" }
10+
system-lambda = { group = "com.github.stefanbirkner", name = "system-lambda", version = "1.2.1" }
11+
wiremock = { group = "com.github.tomakehurst", name = "wiremock-jre8", version = "2.33.2" }
12+
jjwt-api = { module = "io.jsonwebtoken:jjwt-api", version.ref = "jjwt" }
13+
jjwt-impl = { module = "io.jsonwebtoken:jjwt-impl", version.ref = "jjwt" }
14+
jjwt-jackson = { module = "io.jsonwebtoken:jjwt-jackson", version.ref = "jjwt" }
15+
16+
[bundles]
17+
retrofit2 = ["retrofit2-converter-jackson", "retrofit2-retrofit"]
18+

line-bot-api-client/build.gradle.kts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,20 @@ dependencies {
5050
api(project(":line-bot-model"))
5151
implementation("org.slf4j:slf4j-api")
5252
implementation("com.squareup.okhttp3:logging-interceptor")
53-
implementation("com.squareup.retrofit2:converter-jackson")
54-
implementation("com.squareup.retrofit2:retrofit")
53+
implementation(libs.bundles.retrofit2)
5554

5655
testCompileOnly("org.projectlombok:lombok")
5756
testAnnotationProcessor("org.projectlombok:lombok")
5857

59-
testImplementation("com.github.stefanbirkner:system-lambda")
60-
testImplementation("com.github.tomakehurst:wiremock-jre8")
58+
testImplementation(libs.system.lambda)
59+
testImplementation(libs.wiremock)
6160
testImplementation("org.springframework.boot:spring-boot-starter-test")
6261

6362
integrationTestCompileOnly("org.projectlombok:lombok")
6463
integrationTestAnnotationProcessor("org.projectlombok:lombok")
65-
integrationTestImplementation("com.google.guava:guava")
66-
integrationTestImplementation("io.jsonwebtoken:jjwt-api")
67-
integrationTestImplementation("io.jsonwebtoken:jjwt-jackson")
64+
integrationTestImplementation(libs.guava)
65+
integrationTestImplementation(libs.jjwt.api)
66+
integrationTestImplementation(libs.jjwt.jackson)
6867
// https://github.com/jwtk/jjwt/issues/236 jjwt doens't support JWK parsing, yet.
6968
// Once jjwt support JWK, we can remove this dependency.
7069
integrationTestImplementation("com.nimbusds:nimbus-jose-jwt:9.23")
@@ -78,5 +77,5 @@ dependencies {
7877
integrationTestImplementation("org.junit.vintage:junit-vintage-engine") {
7978
exclude(group = "org.hamcrest", module = "hamcrest-core")
8079
}
81-
integrationTestRuntimeOnly("io.jsonwebtoken:jjwt-impl")
80+
integrationTestRuntimeOnly(libs.jjwt.impl)
8281
}

line-bot-cli/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ dependencies {
2222
implementation(project(":line-bot-spring-boot"))
2323
implementation(project(":line-bot-api-client"))
2424
implementation("org.springframework.boot:spring-boot-starter-web")
25-
implementation("com.google.guava:guava")
25+
implementation(libs.guava)
2626
implementation("org.yaml:snakeyaml")
2727

28-
testImplementation("com.github.stefanbirkner:system-lambda")
28+
testImplementation(libs.system.lambda)
2929
testImplementation("org.springframework.boot:spring-boot-starter-test")
3030
}
3131

line-bot-model/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ dependencies {
2323

2424
testImplementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
2525
testImplementation("com.fasterxml.jackson.module:jackson-module-parameter-names")
26-
testImplementation("com.google.guava:guava")
26+
testImplementation(libs.guava)
2727
testImplementation("org.springframework.boot:spring-boot-starter-test")
2828
}

line-bot-parser/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ dependencies {
1919
implementation("com.fasterxml.jackson.core:jackson-databind")
2020
implementation("org.slf4j:slf4j-api")
2121

22-
testImplementation("com.google.guava:guava")
22+
testImplementation(libs.guava)
2323
testImplementation("org.springframework.boot:spring-boot-starter-test")
2424
}

line-bot-servlet/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies {
1919
api(project(":line-bot-model"))
2020
implementation(project(":line-bot-parser"))
2121
implementation("com.fasterxml.jackson.core:jackson-databind")
22-
implementation("com.google.guava:guava")
22+
implementation(libs.guava)
2323

2424
compileOnly("javax.servlet:javax.servlet-api")
2525
compileOnly("org.slf4j:slf4j-api")

line-bot-spring-boot/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ dependencies {
2020
implementation(project(":line-bot-parser"))
2121
implementation("org.springframework.boot:spring-boot-autoconfigure")
2222
implementation("org.springframework.boot:spring-boot-starter-web")
23-
implementation("com.google.guava:guava")
23+
implementation(libs.guava)
2424

2525
compileOnly("javax.validation:validation-api")
2626

27-
testImplementation("com.github.stefanbirkner:system-lambda")
28-
testImplementation("com.github.tomakehurst:wiremock-jre8")
27+
testImplementation(libs.system.lambda)
28+
testImplementation(libs.wiremock)
2929
testImplementation("org.hibernate.validator:hibernate-validator")
3030
testImplementation("org.springframework.boot:spring-boot-starter-test") // MockHttpServletRequest
3131
testImplementation("org.springframework.boot:spring-boot-starter-logging")

sample-spring-boot-kitchensink/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ apply(plugin = "org.springframework.boot")
1919
dependencies {
2020
implementation(project(":line-bot-spring-boot"))
2121
implementation("org.springframework.boot:spring-boot-starter-web")
22-
implementation("com.google.guava:guava")
22+
implementation(libs.guava)
2323
}

0 commit comments

Comments
 (0)