snowplow / snowplow-java-tracker

Snowplow event tracker for Java. Add analytics to your Java desktop and server apps, servlets and games. (See also: snowplow-android-tracker)
http://snowplowanalytics.com
Apache License 2.0
23 stars 36 forks source link

`okhttp3.CookieJar` import in `NetworkConfiguration` causes issues when dependency is not present #361

Closed noahmoss closed 7 months ago

noahmoss commented 1 year ago

Hey, we're using this library from within a Clojure code base over at Metabase and I just tried to update to 1.0.0 (in this PR) but I'm running into an issue that I think should be considered a bug.

We're using Apache HTTP instead of OkHttp, so we don't have OkHttp as a dependency. This doesn't seem to be a problem when building our project normally, but we're getting a ClassNotFoundException when running one of our linters. This is because NetworkConfiguration.java imports okhttp3.CookieJar which the linter tries and fails to load.

It seems odd that the class that's required to be used to avoid using OkHttp nevertheless has it as a dependency. Is there any way to work around this, is there a way to restructure the code to avoid this? (I'd be happy to help out if there's a simple way to do this)