spring-boot子模块打包的jar中去掉BOOT-INF文件夹

原文:https://blog.csdn.net/zsywangyi/article/details/78319130

一、多子模块项目(多个依赖)

1.spring-boot maven打包,一般pom.xml文件里会加


    org.springframework.boot
    spring-boot-maven-plugin


这样打的jar里会多一个目录BOOT-INF。

2.引起问题,程序包不存在。

3.解决办法,如果A子模块包依赖了B子模块包,在B子模块的pom文件,加入


    org.springframework.boot
    spring-boot-maven-plugin
    
        true
    

设置skip就能去掉BOOT-INF文件夹


        true
    


二、单模块项目也一样这样处理

你可能感兴趣的:(java,springboot)