How to deploy spring boot web application on tomcat server

后端 未结 5 936
清歌不尽
清歌不尽 2020-12-04 16:50

I have created spring boot web application, but I am unable to deploy spring boot web application WAR file on tomcat and I am able to run it as java application. How to run

5条回答
  •  [愿得一人]
    2020-12-04 17:33

    The process of converting a spring boot jar to a spring boot war is documented at: http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#build-tool-plugins-maven-packaging Long story short, set your starter class the way you did in your example and then switch the packaging from jar to war in the .pom file. Furthermore, you need to set the spring-boot-starter-tomcat dependency to provided. Once again, the process is documented in it's complete form at the link above. Further information about this subject is available in the spring io guide, "Converting a Spring Boot JAR Application to a WAR" which is available at https://spring.io/guides/gs/convert-jar-to-war/ If i can be of any further assistance, let me know and i will help you.

提交回复
热议问题