Xanium1 / GemsEconomy

One of my spigot plugins. Minecraft Economy plugin with multi currency support!
14 stars 30 forks source link

Relocate com.zaxxer.hikari to avoid conflicts with other plugins #18

Open A248 opened 2 years ago

A248 commented 2 years ago

If you open up the GemsEconomy jar, you'll find com/zaxxer/hikari because GemsEconomy uses HikariCP.

However, the way HikariCP has been included in GemsEconomy means that GemsEconomy's HikariCP can clash with other plugins if those other plugins also use the same library. Two plugins relying on different versions of the same library will run into issues if both of them use the same namespace. In this case, the namespace is com.zaxxer.hikari.

As the CraftBukkit wiki warns:

Plugins should relocate their dependencies to avoid conflicts between plugins, which may result in nausea, vomiting, upset stomach, and/or death unintended behavior or exceptions. https://bukkit.fandom.com/wiki/Using_External_Libraries_with_Plugins

A248 commented 2 years ago

Besides com.zaxxer.hikari, GemsEconomy also includes org.slf4j. Like HikariCP, the slf4j library should be relocated in the same fashion.

ajh123 commented 1 year ago

On the main spigot page it says this mod is "DISCONTINUED". However I have found https://github.com/ArcanePlugins/Polyconomy and https://github.com/ArcanePlugins/Treasury (to be used together) which offer similar features to GemsEconomy.