MobHunting

MobHunting

114k Downloads

Missing dependency declaration

SlimeDog opened this issue ยท 5 comments

commented

Spigot 1.15.2 (Jenkins 2596)
MobHunting 6.9.9-b965

Description
Beginning with Spigot 1.15.2 (Jenkins 2596), missing dependency declarations are reported in the log on server start-up as WARN messages.

Reference: https://hub.spigotmc.org/jira/browse/SPIGOT-5546

The relevant log entry is:

[22:04:13] [Server thread/WARN]: [MobHunting] Loaded class org.inventivetalent.update.spiget.UpdateCallback from BiomeFinder v1.2.9 which is not a depend, softdepend or loadbefore of this plugin.

Steps to reproduce the behavior

  • Update Spigot to 1.15.2 latest
  • Start the server
  • Search the log for 'Loaded class'

Expected behavior
Dependencies should be declared in plugin.yml

commented

Well Mobhunting is not dependend on BiomeFinder ???? I dont even know that plugin.

commented

and yet... the issue persists in MH 7.0.0-b967
Is there additional information I can provide?

commented

My guess is that the developer of Biomfinder has imported the class org.inventivetalent.update.spiget.UpdateCallback directly into the source code instead of adding it as a dependency in the pom.xml file. The dev should import Inventive talents source code into his own.

MobHunting is NOT dependend on Biomfinder, but it IS dependend on org.inventivetalent.update.spiget.UpdateCallback

commented

I will close this ticket, because MobHunting is not dependend on Biomfinder and I think it is the Dev og Biomfinder which have done things the wrong way. Or the warning is wrong.

commented

The actual "issue" here is the fact that both of these plugins shade the org.inventivetalent.update.spiget.UpdateCallback class. BiomeFinder happens to be loaded first, thus when MobHunting attempts to use the class, the classloader finds it's already loaded and the one from BiomeFinder's jar is used.

Since the classes are identical (or at least no methods are used which differ), there is no issue at runtime. But if the two classes were significantly different, then you'd see an issue where the methods you're trying to use do not match the methods available in the class that's loaded.

If you want to make sure you're using the class that you packaged within your .jar, you'd want to shade it to a different package in your .jar.