title: Why do I need main method if I develop web app as war using Spring Boot?
body: <p>I am developing web app using Spring Boot. My typical deployment is generating <code>war</code> and place it in <code>webapps</code> folder in Tomcat directory.</p>
  
  <p>I noticed with <a href="http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-create-a-deployable-war-file" rel="noreferrer">SpringBoot</a>, I will need a <code>main</code> method. I am wondering why this is needed. If there is a way to avoid it, what would that be?</p>
  
  <pre><code>@SpringBootApplication
  public class Application extends SpringBootServletInitializer {
  
      @Override
      protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
          return application.sources(Application.class);
      }
  
      public static void main(String[] args) throws Exception {
          SpringApplication.run(Application.class, args);
      }
  
  }
  </code></pre>