Skip to content

Commit 7f52d7d

Browse files
authored
Use jackson bom and update jackson 20.2 (#1720)
Resolve #1710 Resolve #1709 The version update failed because jackson-annotation no longer specifies patch versions. Instead, we will use jackson-bom and stop specifying individual versions. FasterXML/jackson-annotations#307 (comment)
1 parent e476eb0 commit 7f52d7d

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

gradle/libraries.versions.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[versions]
22
retrofit2 = "3.0.0"
33
jjwt = "0.13.0"
4-
jackson = "2.19.2"
4+
jackson = "2.20.0"
55
assertj = "3.27.4"
66
junit = "5.13.4"
77
junitPlatformLauncher = "1.13.4"
@@ -21,10 +21,11 @@ logback = { module = "ch.qos.logback:logback-classic", version = "1.5.18" }
2121
okhttp3 = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp3" }
2222
okhttp3-logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp3" }
2323

24-
jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" }
25-
jackson-annotations = { module = "com.fasterxml.jackson.core:jackson-annotations", version.ref = "jackson" }
26-
jackson-datatype-jsr310 = { module = "com.fasterxml.jackson.datatype:jackson-datatype-jsr310", version.ref = "jackson" }
27-
jackson-module-parameter-names = { module = "com.fasterxml.jackson.module:jackson-module-parameter-names", version.ref = "jackson" }
24+
jackson-bom = { module = "com.fasterxml.jackson:jackson-bom", version.ref = "jackson" }
25+
26+
jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind" }
27+
jackson-annotations = { module = "com.fasterxml.jackson.core:jackson-annotations" }
28+
jackson-datatype-jsr310 = { module = "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" }
2829

2930
findbugs-jsr305 = { module = "com.google.code.findbugs:jsr305", version = "3.0.2" }
3031

line-bot-integration-test/src/integrationTest/java/com/linecorp/bot/client/utils/IntegrationTestSettingsLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static IntegrationTestSettings load() throws IOException {
3535
.isNotNull();
3636

3737
IntegrationTestSettings settings = new ObjectMapper(new YAMLFactory())
38-
.readValue(TEST_RESOURCE, IntegrationTestSettings.class);
38+
.readValue(TEST_RESOURCE.openStream(), IntegrationTestSettings.class);
3939

4040
assumeThat(settings.enabled() != null && !settings.enabled())
4141
.as("Integration test was disabled.")

line-bot-jackson/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ plugins {
2020
}
2121

2222
dependencies {
23+
api(platform(libs.jackson.bom))
2324
api(libs.jackson.databind) // Provide configured ObjectMapper.
2425
implementation(libs.jackson.datatype.jsr310)
2526
}

line-bot-webhook/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ plugins {
2121

2222

2323
dependencies {
24+
implementation(platform(libs.jackson.bom))
25+
2426
compileOnly(libs.jackson.annotations)
2527
compileOnly(libs.javax.annotation)
2628
compileOnly(libs.jakarta.annotation.api)

tests/maven-pom-validation-test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
fails = 0
3232

3333
pattern = re.compile("""<dependency>.*?</dependency>""", re.DOTALL)
34+
jackson_groupid_pattern = re.compile("""<groupId>com\.fasterxml\.jackson.*?</groupId>""")
3435
root = Path(os.path.expanduser("~/.m2/repository/com/linecorp/bot/"))
3536
for fname in root.glob("**/*.pom"):
3637
if fname.name.startswith("line-bot-spring-boot"):
@@ -42,6 +43,9 @@
4243
content = fp.read()
4344
for dependency in re.findall(pattern, content):
4445
if "<version>" not in dependency:
46+
# Skip Jackson dependencies - they are managed by BOM
47+
if jackson_groupid_pattern.search(dependency):
48+
continue
4549
print(dependency)
4650
fails += 1
4751

0 commit comments

Comments
 (0)