Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zlt2000/springs-boot-plugin-test
Spring Boot 动态加载 Jar 包,并配置为 Bean
https://github.com/zlt2000/springs-boot-plugin-test
jar plugin spring-boot
Last synced: about 2 months ago
JSON representation
Spring Boot 动态加载 Jar 包,并配置为 Bean
- Host: GitHub
- URL: https://github.com/zlt2000/springs-boot-plugin-test
- Owner: zlt2000
- Created: 2021-09-14T05:48:25.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-02-17T15:04:45.000Z (almost 2 years ago)
- Last Synced: 2024-10-15T04:43:50.511Z (2 months ago)
- Topics: jar, plugin, spring-boot
- Language: Java
- Homepage: http://zlt2000.cn
- Size: 3.47 MB
- Stars: 72
- Watchers: 5
- Forks: 43
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#### 详细说明
[《Spring Boot 如何热加载jar实现动态插件?》](https://mp.weixin.qq.com/s/Fg-jsoFon5LwsPAaBbeiew)#### 目录结构
- **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`