testcontainers-java
testcontainers-java copied to clipboard
Fix: Shade jackson-annotations and jackson-core to avoid classpath conflicts
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(anapidependency) brings injackson-annotationsas transitive- The shading logic excludes all
apitransitives from being shaded - So
jackson-annotationsremained unshaded whilejackson-databindwas relocated
Fix
- Exclude
jackson-annotationsfromdocker-java-api - Add explicit
shadeddependencies forjackson-annotationsandjackson-core - Added tests to verify both are properly shaded