第一步:修改打包格式,在packing中填入war
<groupId>com.ttoa</groupId>
<artifactId>sup</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>sup</name>
<packaging>war</packaging>
<description>ctsk_sup</description>
在packing中填入war
第二步:修改tomcat的相关配置
在idea中使用的tomcat和部署到tomcat之后的项目会有冲突
<!--打war包时添加-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
第三步 修改入口函数
public class CtskSupApplication extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(CtskSupApplication.class, args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(CtskSupApplication.class);
}
}
第四歩 点击侧边lifecycle-package即可