diff --git a/pom.xml b/pom.xml index 91de33819..36903decd 100644 --- a/pom.xml +++ b/pom.xml @@ -13,10 +13,17 @@ 0.0.1-SNAPSHOT java-docs-spring-hello-world Demo project for Spring Boot + war 11 + + + org.springframework.boot + spring-boot-starter-tomcat + provided + org.springframework.boot spring-boot-starter-web @@ -30,6 +37,8 @@ + + ROOT org.springframework.boot diff --git a/src/main/java/com/example/demo/DemoApplication.java b/src/main/java/com/example/demo/DemoApplication.java index f594b5bc3..1c5eba242 100644 --- a/src/main/java/com/example/demo/DemoApplication.java +++ b/src/main/java/com/example/demo/DemoApplication.java @@ -2,12 +2,13 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @SpringBootApplication @RestController -public class DemoApplication { +public class DemoApplication extends SpringBootServletInitializer { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args);