testcontainers-java icon indicating copy to clipboard operation
testcontainers-java copied to clipboard

Fix: Shade jackson-annotations and jackson-core to avoid classpath conflicts

Open anqorithm opened this issue 1 week ago • 0 comments

Description:

Fixes #11236

Problem

Users with older Jackson versions (e.g., 2.12.7) encounter NoSuchFieldError: READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE because jackson-annotations was not being shaded alongside jackson-databind.

Root Cause

  • docker-java-api (an api dependency) brings in jackson-annotations as transitive
  • The shading logic excludes all api transitives from being shaded
  • So jackson-annotations remained unshaded while jackson-databind was relocated

Fix

  • Exclude jackson-annotations from docker-java-api
  • Add explicit shaded dependencies for jackson-annotations and jackson-core
  • Added tests to verify both are properly shaded

anqorithm avatar Dec 07 '25 03:12 anqorithm