smartcar / java-sdk

Java client SDK for the Smartcar API.
https://smartcar.github.io/java-sdk
MIT License
20 stars 20 forks source link

Extract Dependencies Properly #139

Open wko27 opened 12 months ago

wko27 commented 12 months ago

Hello!

We're observing that the com.smartcar.sdk:java-sdk:3.10.0 includes copies of both Gson and Apache Commons internally.

This is an issue because are including the classes from those libraries with the default package/namespace, i.e. com.google.gson.* and org.apache.commons.*. This means that any code that uses your library and wants to use a DIFFERENT version of those libraries will have collisions.

The most common solutions to this are either to:

  1. repackage those libraries, so instead they are referenced as e.g.com.smartcar.repackaged.internal.google.gson.*
  2. declare those libraries as an implementation dependency instead of an api dependency in your build.gradle properly

For more reading on option 2, please see https://docs.gradle.org/current/userguide/java_library_plugin.html.

Please let me know if you'd like a pull request with one of the two options!