Spring boot – deploy


Spring boot – deploy

Service publishing Tomcat

  • Modify the startup class, inherit the springbootservletinitializer and override the configure method

protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
    return builder.sources(Start.class);
  • Change jar in POM file to war

  • Modify POM to exclude Tomcat plug-in

    1. Servlet API needs to be added, otherwise compilation will fail

  • Package and deploy to container

mvn clean package
1. Put war in the webapp directory, and pay attention to the context
    2. Put the package directory under webapp / root


This is the end of the spring boot tutorial. If you want to know something else, please leave a message and I will organize it as soon as possible.


  1. Spring boot – meet Hello world for the first time

  2. Spring boot – servlet, filter, listener, interceptor

  3. Spring boot – static resource processing, start loading, log processing

  4. Spring boot – database configuration

  5. Spring boot – deploy


If you think my article is useful to you, please like it and collect it. Your support will encourage me to continue to create!