In order to use external libraries in Bukkit plugins, the server must have the required libraries on the classpath. There are several method available that plugins can use to get their libraries onto the classpath.
A plugin can copy the dependencies into the jar, this can be done with maven-shade-plugin. Plugins should relocate their dependencies to avoid conflicts between plugins, which may result in
nausea, vomiting, upset stomach, and/or death unintended behavior or exceptions. Additional information about the maven-shade-plugin can be found at http://maven.apache.org/plugins/maven-shade-plugin/
A plugin can declare a class-path attribute in the jar’s manifest. The classpath is relative to the jar itself, and not where the jvm was invoked from. Plugins should not make any assumptions as to the location of the plugins folder, and cannot be placed in the root of the plugin folder. The entry can be made with the maven-jar-plugin, but is not required to be made. Additional information about the maven-jar-plugin can be found at http://maven.apache.org/plugins/maven-jar-plugin/
For example, class-path
./lib/example.jar declares that example.jar is in the lib directory in the plugins folder. The plugins folder itself however, can be defined as a command line argument to CraftBukkit.
A plugin can have their classloader load additional jars.
Additional jars can be added to the classpath for the jvm with the -cp flag or changing the CLASSPATH environment variable. This is something the plugin itself should not do and must be completed at the discretion of the server administrator. Additional information can be found at http://docs.oracle.com/javase/7/docs/technotes/tools/windows/classpath.html