Spring Boot: SpringBootServletInitializer 已弃用用
2022-08-31 14:16:39
我正在尝试通过遵循此将Spring Boot应用程序部署到JBoss。它运行良好,但SpringBootServletInitializer在1.4.0.RELEASE中被弃用。我应该使用哪一个?
Maven depedency
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version>
</parent>
Java Code
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.web.SpringBootServletInitializer;
@SpringBootApplication
public class DemoApplication extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}