title: Spring Boot: get command line argument within @Bean annotated method
body: <p>I'm building a Spring Boot application  and need to read command line argument within method annotated with @Bean. See sample code:</p>
  
  <pre><code>@SpringBootApplication
  public class Application {
      public static void main(String[] args) {
          SpringApplication.run(Application.class, args);
      }
  
      @Bean
      public SomeService getSomeService() throws IOException {
          return new SomeService(commandLineArgument);
      }
  }
  </code></pre>
  
  <p>How can I solve my issue?</p>