Vault

Vault

7M Downloads

Missing dependency declaration

SlimeDog opened this issue ยท 2 comments

commented

Spigot 1.15.2 (Jenkins 2596)
Vault 1.7.3-b18

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:03:03] [Server thread/WARN]: [Vault] Loaded class com.earth2me.essentials.api.Economy from Essentials v2.17.1.53 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

Same here.

[20:00:48] [Server thread/WARN]: [Vault] Loaded class com.earth2me.essentials.api.Economy from Essentials vEcoCityCraft which is not a depend, softdepend or loadbefore of this plugin.

commented

soft-warning seems fine in this case. we don't want to add a softdep on essentials as we don't want it to force-enable first. I'm also fairly certain that soft-depping on Essentials would break essentials, as Vault is a load-before type plugin and loads on startup. This has been problematic for other plugins in the past because it's a stage where not everything in the server was initialized:
ref: https://github.com/MilkBowl/Vault/blob/master/plugin.yml#L9

The way Vault performs it's detection is that it checks if the class exists before the loader has a chance to load them, but this is fine..
ref: https://github.com/MilkBowl/Vault/blob/master/src/net/milkbowl/vault/Vault.java#L541

Vault will generate warnings on every plugin that hasn't built it's own connector, this is just another reason why I've pushed econ maintainers to write their own connectors. The reason why is because of the reference above. Vault is manually calling Class.forName on built-in plugins to verify if they are on the classPath to determine which adapters to load. This is erroneously being detected as a 'dependency' on the plugin being loaded. Unless there's a better way to pre-load an adapter like this without enabling the plugins themselves then this can't change.

tldr; can't add soft-depend because it breaks load order. Vault needs to load in startup, having Vault trigger plugin loads has been problematic in the past.