一、问题

项目共有common,consumer,productor模块,其中common为公用模块,被consumer,productor模块所依赖,当打包consumer或productor时,出现如下找不到所引用的类问题.

springboot多模块打包出现引用错误问题

springboot多模块打包出现引用错误问题

二、解决方法

经过分析发现common模块pom中包含有spring-boot-maven-plugin,当在consumer或productor模块中打包时,其所依赖的模块若有maven-plugin则会被重新打包,所以就导致了以上问题.

需要把common模块pom中的spring-boot-maven-plugin插件去掉即可.

 

 

相关文章:

  • 2021-06-13
  • 2022-12-23
  • 2022-12-23
  • 2021-09-18
  • 2022-12-23
  • 2022-12-23
  • 2021-08-10
  • 2021-10-31
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-25
  • 2022-12-23
  • 2021-05-17
相关资源
相似解决方案