title: How to run spring boot application both as a web application as well as a command line application?
body: <p>Currently, I am trying to use the <code>CommandLineRunner</code> along with the <code>ConfigurableApplicationContext</code> to run a spring boot application both as a web application by default and as a standalone command line application on demand (via command line parameters of some sort). I am struggling figuring out how to solely run this as a console application when program arguments are supplied. Please any suggestions would help.</p>
  
  <ul>
  <li><a href="https://i.stack.imgur.com/32NsC.png" rel="noreferrer">Main class - SpringApplication</a></li>
  <li><a href="https://i.stack.imgur.com/FaBqJ.png" rel="noreferrer">CommandLineRunner</a></li>
  </ul>