标签:app Servle pack clean over 打包 color xtend sources
修改pom.xml文件中packaging属性项
<packaging>war</packaging>
修改pom.xml文件增加一个依赖
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency>
修改启动类
public class SpringBootStartApplication extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { // 注意这里要指向原先用main方法执行的Application启动类 return builder.sources(Application.class); } }
执行Maven打包命令打包即可生成war包,然后即可用于部署Tomcat
mvn clean package
【Spring Boot】Spring Boot项目部署到外部Tomcat容器
标签:app Servle pack clean over 打包 color xtend sources
原文地址:https://www.cnblogs.com/LiveYourLife/p/9080032.html