Commit cd93a94
Upgrade Jackson to 2.18.8 and drop jackson-module-kotlin (#218)
## What
Upgrades the Jackson BOM from **2.14.2 → 2.18.8** to fix the outstanding
`jackson-core` / `jackson-databind` CVEs, and removes the
`jackson-module-kotlin` dependency that was the real blocker to
upgrading.
This is a clean, minimal alternative to #215 — it fixes the same CVEs
without the test failures that #215 hit on older Gradle versions.
| Package | ID | Fixed |
|---|---|---|
| jackson-core | CVE-2025-52999 | ✅ |
| jackson-core | GHSA-72hv-8253-57qq | ✅ |
| jackson-databind | CVE-2026-54512 | ✅ |
| jackson-databind | CVE-2026-54513 | ✅ |
| jackson-databind | CVE-2026-54514 | ✅ |
## Why the previous approach failed on old Gradle
`jackson-module-kotlin` ≥ 2.13 calls a **Kotlin 1.5** reflection API
(`KClass.isValue()`) during introspection. Because the module excludes
the Kotlin stdlib and relies on the Kotlin bundled inside Gradle at
runtime, the plugin failed on Gradle **5.2–7.2** (which bundle Kotlin
1.3/1.4) with:
```
Failed to notify build listener.
> 'boolean kotlin.reflect.KClass.isValue()'
```
That — not the multi-release jar — was the cause of the old-Gradle
failures in #215. (This is why the module was originally pinned to
`2.12.3` "because higher versions depend upon Kotlin 1.5".)
## The fix
- **Drop `jackson-module-kotlin` entirely.** It is only needed for
*deserialization*; this plugin only ever *serializes*
(`writeValueAsString`), and Jackson's default bean serializer handles
the Kotlin `data class`es via their generated getters.
`JacksonJsonSerializer` now uses a plain `JsonMapper`.
- **Strip `META-INF/versions/**` from the shaded jar.** Jackson 2.15+ is
a multi-release jar with JDK 11/17/21-optimized classes; older Gradle's
bundled ASM can't read those newer class file versions when
instrumenting the plugin classpath
([gradle/gradle#24390](gradle/gradle#24390))
and fails with *"Unsupported class file major version"*. The Java 8 base
classes work everywhere. Stripping all versioned entries (rather than
just 17/21) is robust against future JDK-specific variants.
The `com.gradleup.shadow` migration this depends on already landed on
`main` in #217.
## Verification
Ran the functional test suite locally against previously-failing
combinations:
- ✅ Full `:plugin-test:test` on **Gradle 6.9.4 / JDK 11** and **7.1.1 /
JDK 11** (both previously failed with the Kotlin error) — pass.
- ✅ **Gradle 5.2.1 / 5.6.4 on JDK 8** — no `NoSuchMethodError` and no
*"Unsupported class file major version"* (the shaded jar loads and the
plugin runs).
- ✅ JSON-schema validation and exact property-name assertions in the
suite confirm serialized output is unchanged without the Kotlin module.
Closes #215 (supersedes).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 8dfe77e commit cd93a94
3 files changed
Lines changed: 12 additions & 15 deletions
File tree
- gradle
- plugin
- src/main/kotlin/org/gradle/dependencygraph/util
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | 49 | | |
57 | 50 | | |
58 | 51 | | |
| |||
92 | 85 | | |
93 | 86 | | |
94 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
95 | 94 | | |
96 | 95 | | |
97 | 96 | | |
| |||
Lines changed: 5 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
0 commit comments