Spring-boot combines PF4J to implement plug-in definition, development, packaging, upload, load, unload, start, stop, enable, disable, use and other functions
- pf4j-spring-core: A copy of pf4j-spring, some implementation changed.
- pf4j-manager-spring-boot-starter: Spring boot stater
- demo: A spring boot application with 3 plugins
git clone https://github.com/clyoudu/pf4j-spring.git
Then edit pf4j-spring/demo/manager/src/main/resources/application.yml, change spring.pf4j.path
to another dir
cd pf4j-spring
mvn clean package
cd demo/manager/target
java -jar manager-1.0.0-SNAPSHOT.jar
Open http://localhost:8080
, you will see page like this
Plugin Management:
- You can upload plugins jar in demo/plugins/*/target/*.jar
- Click 'Reload' button, then the plugin list will refresh automatically
- Load/Unload/Start/Stop/Enable/Disable/Delete operations are available for different plugin state
Business Feature:
- With plugin state changed, extension buttons list changed
- Click buttons, a message displayed as plugin extension expected
[] Managing & Using plugin through spring application context is not tested