一、问题
项目共有common,consumer,productor模块,其中common为公用模块,被consumer,productor模块所依赖,当打包consumer或productor时,出现如下找不到所引用的类问题.
二、解决方法
经过分析发现common模块pom中包含有spring-boot-maven-plugin,当在consumer或productor模块中打包时,其所依赖的模块若有maven-plugin则会被重新打包,所以就导致了以上问题.
需要把common模块pom中的spring-boot-maven-plugin插件去掉即可.