netherfoam / MaxBans-Plus

A Bukkit plugin for Minecraft Servers to manage account bans, mutes and restrictions
8 stars 4 forks source link

MaxBans leaking an awful lot of unrelocated dependencies #82

Open A248 opened 4 years ago

A248 commented 4 years ago

Hello, I just wanted to inform you that your plugin is shading many dependencies unrelocated, which is problematic should another plugin choose to use the same dependencies and make the same mistake.

The solution to this is to apply relocations to all of your dependencies, not just the 2 relocations you currently have in the maven-shade-plugin configuration.

netherfoam commented 4 years ago

Do you have a particular server implementation you're replicating the issue in? Spigot / Craftbukkit / Paper MC / etc?

A248 commented 4 years ago

Any. Take a look at the pom.xml - there are multiple dependencies shaded with the maven-shade-plugin which don't have relocations. Open up the plugin jar and you'll see the unrelocated namespaces:

I think you get the idea. If another plugin includes H2, for example, and does not relocate it either, one or both plugins will encounter problems caused by duplicate class definitions. The Bukkit wiki says it best:

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.gamepedia.com/Using_External_Libraries_with_Plugins

netherfoam commented 4 years ago

Thanks, I'll check it out!