Platonos
back to tutorials overviewTutorial 7 - Dependencies (Work in progress, specifications for this feature may change)
Plugin can be powerfull but combining them can make them more powerfull. The Plugin Engine can resolve dependencies between automaticly. For example if pluginA provides an interface which pluginB implement then the Plugin Engine will detect this dependency and add the classloader of pluginA to the dependency list of pluginB so it can see classes from pluginA.
But there may be situations that you want some more control over the dependencies like when your plugin depends on a plugin of a specific version. In those cases you can define the dependencies on your plugin class like this:
@Plugin(name="pluginB", version="0.1") @Dependencies(pluginDependencies={ @PluginDependency(name="pluginA", version="0.1") })
If you plugin requires a minimal version of a JRE you can define that dependency with JREDependency annotation:
@Plugin(name="pluginB", version="0.1") @JREDependency(minMajorVersion=6, minMinorVersion=0) public class PluginB { }
If you use this annotation you have to atleast specify the minVersion, the maxVersion is optional. If the annotation is not present then no checking will be done on the JRE version.
Its also posible to specify a maxMajorVersion and maxMinorVersion but that is optional.