SpringBoot打包

Time: 2024-06-02 Sunday 04:37:01
Author: Jackasher

SpringBoot打包

原来spring配置多出来的这个类是来打war包的

1
2
3
4
5
6
7
8
9
10
11
12
13
14
package com.example.springboot;

import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

public class ServletInitializer extends SpringBootServletInitializer {

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

}

spring真的我哭死,这个地方还加了provided已经

1
2
3
4
5
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>

SpringBoot打包
http://example.com/2024/06/02/SpringBoot打包/
作者
Jack Asher
发布于
2024年6月2日
许可协议