1.8.8 Maven pom Dependency Help

Discussion in 'Spigot Plugin Development' started by Nrc0611, Jan 28, 2020.

Thread Status:
Not open for further replies.
  1. Ok so I am currently working on a custom spigot jar and I am trying to add a plugin as a dependency for the spigot jar which will be in my plugins folder on the server.

    Code (Text):

    This does compile in maven but when im on the server I get this error. I have tried using a different scope for provided and compile (as I have maven shader) but I cannot seem to compile the spigot jar without the systemPath otherwise it throws errors and cannot find the dependency.

    Code (Text):

    java.lang.NoClassDefFoundError: com/kiwifisher/mobstacker2/metadata/MetaTags
    Any help is appreicated, thank you!
  2. md_5

    Administrator Developer

    There's no trivial way for the server to access plugins, I suggest you rethink your design
  3. TeamBergerhealer


    More than likely youre trying to access plugin classes before the plugin is loaded on the server. The only way to do that is to load the jar file at bootup and initialize it manually, instead of utilizing the plugin class loader.

    Easier would be to add some simple interface in your modified spigot code that allows your plugin to register its utilities in the server. For example, by defining an interface class with methods the server wants to call, implementing it in mobstacker (or your own plugin), and assigning it to a field in the server. Eg:

    Code (Text):
    class SomeClassOnSpigotServer {
        private static MobStackerAPI _mobStackerAPI = null;

        public static void registerMobStacker(MobStackerAPI api) {
            _mobStackerAPI = api;

        public static MobStackerAPI getMobStackerAPI() {
            return _mobStackerAPI

    interface MobStackerAPI {
        void stack(); // idk?


    // In your plugin
    class MobStackerImpl implements org.spigotmc.somepath.MobStackerAPI {
        public void stack() {
            // implement it

    // In your plugin onEnable()
    SomeClassOnSpigotServer.registerMobStacker(new MobStackerImpl());
    You would have to check, in your server, whether the api is registered (not null) before accessing it
  4. Thank you for the quick responses I ended up solving it by merging the plugin with the spigot jar source code to include the Mob Stacker in the jar.
Thread Status:
Not open for further replies.