How to deploy spring boot web application on tomcat server

后端 未结 5 942
清歌不尽
清歌不尽 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:30

    Mark the spring-boot-starter-tomcat dependency as provided, like:

    
                org.springframework.boot
                spring-boot-starter-tomcat
                provided
    
    

    Note1: Remove redundant dependencies from your pom.xml like:

    
            org.springframework
            spring-beans
    
    
            org.springframework
            spring-webmvc
    
    

    They are part of spring boot starter packages

    Note2: Make jar not war

提交回复
热议问题