【发布时间】:2016-12-15 01:03:04
【问题描述】:
我正在尝试按照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);
}
}
【问题讨论】:
-
你能澄清你的问题吗,我看到在你的代码中你已经表明你使用了 @springBootApplication 而不是 SpringBootServletInitializer 。两者有什么关系?
-
是的,你是对的。我的问题是不充分的。我已经更新了我的问题。
标签: java spring-boot