EasyLoader is a simple drop-and-play plugin-system for Java.
It consists of two parts: EasyLoader
(a directory-capable ClassLoader
), and EasyPlugin
(a no-xml dependency injector).
It relies on Google Guice and Daniel Manzke's Guice Auto-Binding system.
- Implement
Application
. - Implement your Guice modules and annotate them with
@GuiceModule
(from Guice Auto-Binding). - Make sure your modules are all in the same package.
- Have one of the modules bind the implemented application.
- Package the modules into jars and drop all of them into a folder.
- Make a main class similar to this:
public static void main(String[] arguments){
String libraryAndModuleFolder = "./src/test/resources/";
String modulePackage = "de.butatopanto.test";
EasyLoader loader = new EasyLoader(new File(libraryAndModuleFolder));
EasyPlugin easyPlugin = new EasyPlugin(loader, modulePackage);
easyPlugin.startApplication();
}