title: Deploy Spring Boot app to AWS Beanstalk
body: <p>What would be the best way to deploy Spring Boot project, preferable just jar, to AWS Beanstalk environment. Or should I just convert it to WAR and deploy it that way?</p>
  
  <hr>
  
  <p>Solution:</p>
  
  <p>Basically what I did was this: </p>
  
  <ol>
  <li><p>Created new class to tell Spring Boot that my app is a web app and that I need to create all necessary configs:</p>
  
  <blockquote>
  <pre><code>public class MyBootWebApp extends SpringBootServletInitializer { 
  
  @Override
  protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return
  </code></pre>
    
    <p>application.sources(MyBootApp.class);
           }
        }</p>
  </blockquote></li>
  </ol>
  
  <p>(2) inside .pom file changed packaging to war like this: <code>&lt;packaging&gt;war&lt;/packaging&gt;</code></p>
  
  <p>That was it.</p>