插件机制

liuyanming.lym e7a7d97e3c test reload 1 year ago
plugin-impl e7a7d97e3c test reload 1 year ago
plugin-interface ddaec65b83 修改代码结构 1 year ago
plugin-users e7a7d97e3c test reload 1 year ago
plugins e7a7d97e3c test reload 1 year ago
.gitignore 74110e5976 init 2 years ago
README.md b0f0d59c14 优化代码 1 year ago
pom.xml e7a7d97e3c test reload 1 year ago

README.md

详细说明

《Spring Boot 如何热加载jar实现动态插件?》

目录结构

  • plugin-impl:插件实现
  • plugin-users:插件使用样例
  • plugins:插件包存放目录

测试 Spring Boot 动态加载 Jar 包

  1. 启动时动态加载
  2. 运行时动态加载

测试步骤

进入 plugin-users 工程

  1. 修改 application.properties 中的 targetUrl 参数值为本机 plugin 目录中 jar 的实际绝对路径
  2. 启动 plugin-users 工程
  3. 测试启动时动态加载jar:http://127.0.0.1:8080/test
  4. 测试运行时动态加载jar:http://127.0.0.1:8080/reload
  5. 测试运行时动态卸载jar: http://127.0.0.1:8080/remove