-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow exclusion of org.json dependency #3249
Conversation
Move creation of the JSON command builders to a separate class which is initialized only when any of the JSON methods are being used. This allows org.json transitive Maven dependency to be excluded for the applications which don't use JSON methods. See redis#2961 and redis#2962 for more information and rationale. Similar to redis#3223
@sazzad16 Can you review this one please? It is similar to the one for GSON. |
@agavrilov76 org.json classes (JSONObject, JSONArray) are present in CommandObject class. So this change won't work like it did for Gson. |
@sazzad16 I've successfully tested this change. I think it is going to work. JVM will load org.json classes only when the JSON command objects are actually being created, that is, the first time jsonXXX methods are called. I can create a repo to demo. |
@agavrilov76 You're right. Just tested myself. Seems to be working. Thanks! |
@sazzad16 do you plan to release 4.4.0 soon ? |
@agavrilov76 4.4.0 seems to take some time. Please use latest milestone release (if possible). Those can be considered as good as the full release (with rare breaking changes). |
@sazzad16 I'm waiting for the release with an ability to exclude unwanted JSON dependencies (the one I've contributed with :)) so I can migrate to 4.X. I hope you can find time to release 4.4.0 some time soon (thanks for maintaining the project, btw!) |
Move creation of the JSON command builders to a separate class which is initialized only when any of the JSON methods are being used. This allows org.json transitive Maven dependency to be excluded for the applications which don't use JSON methods.
See #2961 and #2962 for more information and rationale. Similar to #3223