springboot项目发布到linux服务器上(使用自己的tomcat)
1、在 pom.xml 中导入依赖来阻止springvoot内置的tomcat <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency> 2、修改服务器启动类使其继承 SpringBootServletInitializer 类并重写其 configure 方法 package com.woniuxy.app; import org.mybatis.spring.annotation.MapperScan; 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; import