spring-boot打成war包放入tomcat运行
2020-12-13 03:56
标签:ram demo nap ring compile 重写 configure from location 一、application集成SpringBootServletInitializer(重写configure方法) 二、配置pom.xml 三、完成后进行编译打包 编译:mvn clean compile 打包:mvn clean package spring-boot打成war包放入tomcat运行 标签:ram demo nap ring compile 重写 configure from location 原文地址:https://www.cnblogs.com/zhizou/p/11095469.htmlimport 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 Hello2Application extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
//主要目的是构建成war包使用其他Web服务器去构建。
return builder.sources(Hello2Application.class);
}
public static void main(String[] args) {
SpringApplication.run(Hello2Application.class, args);
}
}