第一步
修改pom文件
更改打包方式
<packaging>war</packaging>
增加依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
重写springbootapplication
public classWeixinApplicationextendsSpringBootServletInitializerimplementsWebApplicationInitializer{
@Override
protectedSpringApplicationBuilder configure(SpringApplicationBuilder builder) {
returnbuilder.sources(WeixinApplication.class);
}
public static voidmain(String[] args) {
SpringApplication.run(WeixinApplication.class, args);
}
}
第二步
build --->build project
build---->build artifacts---->all artifacts---->build
网友评论