spring boot将jar包转换成war包发布

时间:2021-12-05 04:48:44

spring boot将jar包转换成war包发布步骤

  1. 将<packaging>jar</packaging>修改为<packaging>war</packaging>
  2. 增加下面的依赖覆盖默认内嵌的Tomcat依赖
           <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>

  3. 增加ServletInitializer类