Create war file from Spring:boot project in Eclipse

好久不见. 提交于 2019-11-30 14:10:09

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

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

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.

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.

To generate WAR file in STS (Spring Tools Suite): Run as-> Maven Install

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!