Notice
I wrote this article and was originally published on Qiita on 23 August 2022.
On Servlet 3.0 container
If you plan to run your project on Servlet 3.0 container (e.g. Apache Tomcat start from 7.0), it is very easy to convert the project from run in command line to run in a Servlet container.
- in software project management tool, change generate file format from jar to war, and prevent to append version number to file name
- include org.springframework.boot:spring-boot-starter-tomcat into project's dependency
- change the class which annotated with @SpringBootApplication, to extend org.springframework.boot.web.servlet.support.SpringBootServletInitializer
That's all!