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

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

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

这样打的jar里会多一个目录BOOT-INF,一般多模块工程里面会存在一个api的module,该模块是要打包成jar包的,如果包含BOOT-INF目录会出现引用问题,那么需要去掉该目录,才会被其他模块正确引用。

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

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

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <skip>true</skip>
    </configuration>
</plugin>

猜你喜欢

转载自blog.csdn.net/zxf_noimp/article/details/88693714