1、有中间件的可以去掉tomcat
<!--去除打包时tomcat依赖,本地开发环境生效 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
2、应用启动类添加外部启动支持,application继承extends SpringBootServletInitializer
/**
* 用于支持通过外部容器方式启动
*/
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(this.getClass());
}
3、增加maven打包插件,同时包类型改为war
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<warName>smart-batch-starter</warName>
<!--<webResources>
<resource>
<directory>${project.basedir}/lib</directory>
<targetPath>