外置tomcat部署SpringBoot项目

一、main方法所在Class修改为一下配置

 

代码:

@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
    return application.sources(DemoApplication.class);
}

 

二、修改pom.xml文件

  1. 外部tomcat配置
  2. 修改
<!--外置tomcat启动-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-tomcat</artifactId>
    <scope>provided</scope>
</dependency>
<packaging>war</packaging>

 

posted @ 2020-05-12 16:55  爱河  阅读(227)  评论(0编辑  收藏  举报