[Do not Merge] feat: add java-sdk-shaded artifact with org.json shading#114
Open
ppatibandla wants to merge 1 commit intomainfrom
Open
[Do not Merge] feat: add java-sdk-shaded artifact with org.json shading#114ppatibandla wants to merge 1 commit intomainfrom
ppatibandla wants to merge 1 commit intomainfrom
Conversation
Some enterprise customers have org.json blocked at the JVM level, causing NoClassDefFoundError at runtime. This introduces a new artifact 'java-sdk-shaded' that shades org.json into com.amplitude.shaded.org.json, bundling it directly in the SDK JAR. The shaded artifact has no external org.json dependency, resolving blocking issues for affected customers. Customers have two migration options: 1. Update imports from org.json.JSONObject to com.amplitude.shaded.org.json.JSONObject (same API) 2. Use the Map-based helper methods (setEventProperties, setUserProperties, etc.) that don't expose JSONObject directly Changes: - Add Gradle Shadow plugin to relocate and bundle org.json classes - Create new artifact 'java-sdk-shaded' at version 1.13.0 - Configure publishing to use shaded JAR with no org.json dependency in POM - Disable signing for mavenLocal to enable local testing
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.
Summary
Some enterprise customers have org.json blocked at the JVM level, causing NoClassDefFoundError at runtime. This introduces a new artifact 'java-sdk-shaded' that shades org.json into com.amplitude.shaded.org.json, bundling it directly in the SDK JAR.
The shaded artifact has no external org.json dependency, resolving blocking issues for affected customers. Customers have two migration options:
Changes:
Checklist