Bundle commons-codec with common.eval to complete commons-csv's closure#66
Merged
Merged
Conversation
The commons-io fix in v5.6.0 (#65) got the bundled commons-csv past its first missing transitive dependency, but commons-csv 1.12.0's runtime closure is both commons-io and commons-codec: it references org.apache.commons.codec.binary.Base64OutputStream, yielding a second NoClassDefFoundError under strict OSGi classloading in a materialized product. commons-csv's own OSGi manifest enumerates its complete runtime closure via Import-Package: exactly org.apache.commons.codec.binary and the org.apache.commons.io.* packages. So the closure is bounded (io plus codec), not open-ended. Bundle commons-codec 1.17.1 the same way commons-io and commons-csv are bundled: self-contained, private to this bundle's classloader (not exported), so common.eval carries its entire commons-csv closure inside its own classloader regardless of what else the product assembles. Maintenance note: on each future commons-csv upgrade, re-check the csv jar's manifest Import-Package and bundle any newly added transitive dependency. Re #64. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015jRmWZMAqpMDjsKmTATy3A
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The commons-io fix in v5.6.0 (#65) got the bundled commons-csv past its first missing transitive dependency, but commons-csv 1.12.0's runtime closure is both commons-io and commons-codec. It references
org.apache.commons.codec.binary.Base64OutputStream, so a materialized product now fails one step further under strict OSGi classloading:Why Bundling (Not Option 2)
commons-csv's own OSGi manifest enumerates its complete runtime closure via
Import-Package: exactlyorg.apache.commons.codec.binaryand theorg.apache.commons.io.*packages. So the closure is bounded (io plus codec), not open-ended whack-a-mole. Bundling keepscommon.evalself-contained, which is the most robust posture for the materialized headless product that surfaced this (the bundle carries its entire commons-csv closure in its own classloader, rather than depending on the product to assemble extra bundles correctly).Option 2 (depend on the
org.apache.commons.csvbundle) is feasible via a Tycho 5 Maven target location, but it moves three jars out ofcommon.evaland makes the product responsible for including them, more surface area for this same class of failure, to solve a closure problem that is already proven bounded.Fix
Bundle commons-codec 1.17.1 the same way commons-io and commons-csv are bundled:
lib/commons-codec-1.17.1.jar(plus sources/javadoc) tolib/.Bundle-ClassPath(META-INF/MANIFEST.MF).bin.includes(build.properties) so Tycho packages it..classpath) for IDE development.commons-codec is not exported. It stays private to this bundle's classloader, so it does not split-package with a product's own commons-codec bundle.
Maintenance note: on each future commons-csv upgrade, re-check the csv jar's manifest
Import-Packageand bundle any newly added transitive dependency.Re #64.
🤖 Generated with Claude Code