SpringBootServletInitializer

SpringBootServletInitializer

我正在尝试通过遵循this将Spring Boot应用程序部署到JBoss。它工作得很好,但是SpringBootServletInitializer 在1.4.0.RELEASE中已弃用。我应该使用哪一个?

Maven的虔诚

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.4.0.RELEASE</version>
</parent>

Java代码
 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);
        }
    }

最佳答案

您正在使用org.springframework.boot.context.web.SpringBootServletInitializer,已弃用。代替:

利用
org.springframework.boot.web.support.SpringBootServletInitializer
对于SpringBoot 2.0
org.springframework.boot.web.servlet.support.SpringBootServletInitializer

关于java - Spring Boot : SpringBootServletInitializer is deprecated,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/38843015/

10-09 02:51