spring-boot-maven-plugin打war包运行时报ClassNotFoundException

1月 5, 2022 |

Caused by: java.lang.ClassNotFoundException: org.springframework.boot.SpringApplication

spring-boot-maven-plugin 配置如下:

将jar工程按war结构repackage,但是spring-boot-maven-plugin打包的结果不符合war包规范
classes没有放在WEB-INF下

解决办法

添加web.xml<packaging>war</packaging> 让工程按war编译,然后使用spring-boot-maven-plugin重新打包成胖war包

Posted in: spring practise

Comments are closed.