From 3497a4b3eaf981cb933be41acaf14ec53e78f750 Mon Sep 17 00:00:00 2001 From: Philip Z Date: Wed, 23 Sep 2026 08:40:27 +0800 Subject: [PATCH] fix: manage Jackson versions across Java runtime --- .github/workflows/ci.yml | 2 ++ pom.xml | 8 +++++ .../verify-jackson-runtime-dependencies.sh | 35 +++++++++++++++++++ teaql-redis/pom.xml | 1 - teaql-sql-portable/pom.xml | 1 - teaql-utils-json/pom.xml | 1 - 6 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 scripts/verify-jackson-runtime-dependencies.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 557e24b86..25895a937 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,8 @@ jobs: cache: maven - name: Build with Maven run: mvn -B install + - name: Verify managed Jackson runtime versions + run: bash scripts/verify-jackson-runtime-dependencies.sh - name: Validate error catalog run: | python3 -m unittest discover -v diff --git a/pom.xml b/pom.xml index 2fdbda717..665e5c1d4 100644 --- a/pom.xml +++ b/pom.xml @@ -41,6 +41,7 @@ UTF-8 3.2.0 3.20.0 + 2.22.3 @@ -89,6 +90,13 @@ commons-lang3 ${commons-lang3.version} + + com.fasterxml.jackson + jackson-bom + ${jackson-bom.version} + pom + import + org.springframework.boot spring-boot-dependencies diff --git a/scripts/verify-jackson-runtime-dependencies.sh b/scripts/verify-jackson-runtime-dependencies.sh new file mode 100644 index 000000000..37a84a6ec --- /dev/null +++ b/scripts/verify-jackson-runtime-dependencies.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +set -euo pipefail + +repo="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +cd "$repo" + +# Generated applications have their own dependency management. This gate +# verifies published runtime modules and the parent-owned Business ID example. +tree=$(mvn -B -pl '!examples/conformance/lib,!examples/conformance' \ + dependency:tree \ + -Dincludes=com.fasterxml.jackson.core:jackson-databind,com.fasterxml.jackson.core:jackson-core,com.fasterxml.jackson.core:jackson-annotations \ + -DoutputType=text) + +for expected in \ + 'jackson-databind:jar:2.22.3:' \ + 'jackson-core:jar:2.22.3:' \ + 'jackson-annotations:jar:2.22:'; do + if [[ "$tree" != *"$expected"* ]]; then + echo "Expected Jackson dependency not found: $expected" >&2 + exit 1 + fi +done + +unexpected=$(printf '%s\n' "$tree" | awk ' + /com\.fasterxml\.jackson\.core:jackson-databind:jar:/ && !/jackson-databind:jar:2\.22\.3:/ { print } + /com\.fasterxml\.jackson\.core:jackson-core:jar:/ && !/jackson-core:jar:2\.22\.3:/ { print } + /com\.fasterxml\.jackson\.core:jackson-annotations:jar:/ && !/jackson-annotations:jar:2\.22:/ { print } +') +if [[ -n "$unexpected" ]]; then + echo "Runtime reactor resolved a conflicting Jackson version:" >&2 + printf '%s\n' "$unexpected" >&2 + exit 1 +fi + +echo "PASS: runtime Jackson dependencies follow the managed BOM" diff --git a/teaql-redis/pom.xml b/teaql-redis/pom.xml index be7580afb..776f907d9 100644 --- a/teaql-redis/pom.xml +++ b/teaql-redis/pom.xml @@ -34,7 +34,6 @@ com.fasterxml.jackson.core jackson-databind - 2.16.1 diff --git a/teaql-sql-portable/pom.xml b/teaql-sql-portable/pom.xml index 5c1f18fe3..ca6adb3f7 100644 --- a/teaql-sql-portable/pom.xml +++ b/teaql-sql-portable/pom.xml @@ -30,7 +30,6 @@ com.fasterxml.jackson.core jackson-databind - 2.13.5 diff --git a/teaql-utils-json/pom.xml b/teaql-utils-json/pom.xml index 5b8f11d35..5fc6e769f 100644 --- a/teaql-utils-json/pom.xml +++ b/teaql-utils-json/pom.xml @@ -21,7 +21,6 @@ com.fasterxml.jackson.core jackson-databind - 2.13.5 org.junit.jupiter