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

时间:2023-03-10 07:15:03
springboot项目中引用其他springboot项目jar

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

2.打包

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

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

3.打包

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

4.启动类引入

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

5.在pom中引入

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