springboot项目中引用其他springboot项目jar

1. 剔除要引入的springboot项目中不需要的文件:如Application和ApplicationTests等

2.打包

不能使用springboot项目自带的打包插件进行打包:

3.打包

4.启动类引入

在Application启动类@SpringBootApplication(scanBasePackages = {"依赖的项目的class路径", "自己项目的class路径"})

5.在pom中引入

在你的项目的pom.xml中引入你刚刚打包好的项目,如此,便完成了在自己项目中引用别人springboot项目.jar
参考:https://blog.csdn.net/lovexiaotaozi/article/details/83576904

原文地址:https://www.cnblogs.com/xyj179/p/10083740.html