1.第一步:将项目的打包方式改为war
<packaging>war</packaging>
2.引入tomcat依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
- 配置tomcat服务
- 添加一个本地的tomcat服务
- 配置tomcat
- 修改启动类
@SpringBootApplication
public class MsttServerApplication extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(MsttServerApplication.class, args);
}
}