Hi, I have simple plugin that uses external libraries (apache http client) All of them are included in jar file, but they are not loaded by class loader, and it throws NoClassDefFoundError when sponge tries to load the plugin. Idk what am I doing wrong.
What you are describing should work anyway, though a build system is a good thing to use. What did you do, specifically? Does your plugin jar contain the Apache classes, or does it contain the Apache jar itself?
Forge excludes some packages from loading in mods (prevents inconsistent classloading issues).
You’ll need to shade the package when building. Something like renaming org.apache to gt.creeperface.sponge.shaded.apache or whatever
I’m sure there are similar tools for maven, or for no build system, that one can find. “java shading” and “fat jar” are good keywords to search for.