1.在pom.xml里修改或者添加packaging,值为war
2.在pom.xml里添加依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>compile</scope>
</dependency>
3.修改工程的启动类
@SpringBootApplication
public class ParserinterfaceApplicationextends SpringBootServletInitializer
implements WebApplicationInitializer{
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(ParserinterfaceApplication.class);
}
public static void main(String[] args) {
SpringApplication.run(ParserinterfaceApplication.class, args);
}
}
网友评论