-
-
Notifications
You must be signed in to change notification settings - Fork 590
Description
This is an early proposal for a third plugin type. Currently pf4j supports two types: Fat/shade/one-jar and ZIP with lib folder.
The new plugin type would be a thin jar with only plugin code, and a list of dependencies in the form of Maven coordinates (e.g. a pom.xml file or a gradle file or simply a list of coordinates). Pf4j would, once plugin type is identified, resolve dependencies from Maven repos and download the jar dependencies to a myplugin-1.0.0.lib folder next to the plugin itself. A corresponding PluginLoader will then add this lib folder to the class loader.
Identification of this plugin type could be through a special name suffix (*.pf4j), or some hint in plugin descriptor/manifest. The dependency resolution and download could either happen during installation (pf4j-update) or in run-time at plugin load phase; this should be configurable. For dependency resolution we can use the maven-resolver library.
Alternative: If we choose to do this in pf4j-update only, another option could be to download into lib folder and then re-package everything as a .zip plugin which would then be installed into plugins root. This would not need any changes in core at all, but a disadvantage is that core project will not understand this plugin type natively.