Here are two good documentations on how to deploy the Spring Boot App as a war file.
You can follow this spring boot howto-traditional-deployment documentation
https://docs.spring.io/spring-boot/docs/current/reference/html/howto-traditional-deployment.html
¡Ü Steps according to this documentation -
1. You update your application's main class to extend SpringBootServletInitializer.
2. The next step is to update your build configuration so that your project produces a war file
rather than a jar file.
3. Mark the embedded servlet container dependency as provided.
¡Ü and one more way
See this spring io documentation which outlines how to deploy the spring boot app to an application server.
https://spring.io/blog/2014/03/07/deploying-spring-boot-applications#what-about-the-java-ee-application-server
1. Change jar packaging to war.
2. Comment out the declaration of the spring-boot-maven-plugin plugin in your pom.xml
3. Add a web entry point into your application by extending SpringBootServletInitializer
and override the configure method
4. Remove the spring-boot-starter-tomcat dependency and modfiy your spring-boot-starter-web dependency to
In your pom.xml, remove spring-beans and spring-webmvc dependencies.
The spring-boot-starter-web dependency will include those dependecies.
|