title: How to stop a starting spring boot application?
body: <p>Is it possible to stop a spring boot application while it's spinning up?</p>
  
  <p>My software needs to validate a license while starting. If the license does not exist or is not valid the app shall shutdown. The actual validation happens in the <code>@PostConstruct</code> of an <code>@Service</code>.</p>
  
  <p>The way I currently go is:</p>
  
  <pre><code>if (!exist || !valid) {
      System.exit(1);
  }
  </code></pre>
  
  <p>But this solution just feels horrible. Is there a solution I can stop the spring boot application without calling a REST endpoint?</p>