Zum Inhalt

Introduction and Usage

PluginLibrarian is a plugin to include Java libraries that are not plugins themselves.

We consider JAR files without a plugin.yml to be a library, and JAR files with a plugin.yml (and corresponding plugin class) to be a plugin.

Bukkit unfortunately does not offer a built-in way to use libraries. It only offers a dependency system for plugins to depend on other plugins. PluginLibrarian is a plugin that represents all libraries. With that, it provides a simple solution (see How it works).

It supports any server version starting from 1.8, even though there are differences in how this can be implemented between versions.

Plugins installed through the tomatencraft TomatenPack repository install PluginLibrarian along with any library they also depend on, if any. Because libraries are used very often, PluginLibrarian is present in practically every server installation using TomatenPack. Of course, you can also install it directly with tomatenpack install pluginlibrarian.

How it works

On startup, PluginLibrarian effectively pulls JAR files from configured locations (by default every file in lib/) into itself, making them available to other plugins.

So when you make your plugin...

  • List PluginLibrarian in the dependencies in your plugin.yml, either as depend or softdepend. This ensures the included libraries are available at loading and unloading. Do not add the used libraries, they are not plugins.
  • Add the used libraries to your compilation classpath. You may but do not need to add PluginLibrarian too, as you don't call PluginLibrarian directly.
  • When defining a TomatenPack package, depend PluginLibrarian and the used libraries in the package.txt, because installations need both the libraries and PluginLibrarian to include them.