spring boot 打包报错

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.3.0.RELEASE:repackage (default) on project device-factory-service: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.3.0.RELEASE:repackage failed: Duplicate library so.dian.dev-device-factory.jar -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :device-factory-service
 
在执行 mvn clean package 命令打包的时候,抛出上面异常,从错误信息上看,是说device-factory.jar 重复了,我找了半天也不知道这个包怎么重复了,在网上有看见说是插件冲突,我继承了 spring-boot-starter-parent 包和spring-boot-maven-plugin 插件,因为parent中已经有了spring-boot-maven-plugin 插件,所以报错,我按着这个将spring-boot-maven-plugin 删掉确实可以打包了,但是各个工程之间依赖关系并没有打下来。
最后跟一位大佬一起看才知道,我在父工程的pom.xml 定义了
  <build>
    <finalName>device-factory</finalName>
  </build>
因为所有的子工程都继承父的pom,所以其他自工程打出的包也叫device-factory.jar 所以才报重复。后将父工程中finalName删除,果然包打好了,解压后各工程的依赖也在。 我将finalName定义在我web工程pom中,也就是我的入口工程,发布的时候只需要将device-factory.jar 就可以了
 
 

转载于:https://www.cnblogs.com/zhangXingSheng/p/7745012.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值