- 1. pom中添加代码
-
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
@SpringBootApplication
public class CoresysApplication extends SpringBootServletInitializer {
/*public static void main(String[] args) {
SpringApplication.run(CoresysApplication.class, args);
}*/
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(CoresysApplication.class);
}
public static void main(String[] args) throws Exception {
SpringApplication.run(CoresysApplication.class, args);
}
}