Create war file from Spring:boot project in Eclipse

You need to extend ****SpringBootServletInitializer**** in your @SpringBootApplication

You don't need to add the ****sprinng-boot-starter-tomcat**** dependency for war file generation

enter image description here

Use below configuration in pom.xml

<packaging>war</packaging>

Configure Build Path for your project and select JDK

Right click on project > Run As > Maven Install

It will generate the war file inside target folder.

enter image description here

Copy this war and deploy to any web/application server (I have renamed it to demo.war).

You can access the app by using your host name followed by the port and app name.

enter image description here