title: How to replace properties in application.properties in src/main/resources in spring boot
body: <p>I am using Spring boot application and having application.properties property file in src/main/resources. It has some properties which needs to replaced by external property file. I will pass the external file location in command line.</p>
  
  <p>Need solution how to replace the properties inside application with external properties.</p>
  
  <pre><code>public static void main(String[] args) throws JMSException, MQException, IOException {
  
      ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
      InputStream input = classLoader.getResourceAsStream("Application.properties");
      Properties properties = new Properties();
      properties.load(input);
      properties.load(new FileReader(args[0]));
  
      SpringApplication springApplication = new SpringApplication(new Object[]{ChapsSchemeFeed.class});
      springApplication.setDefaultProperties(properties);
      springApplication.run(args);
  }
  </code></pre>
  
  <p>In this code, I am reading properties from command line and loading them with application.properties residing in application. But when I start, its loading properties from Application.properties. But I want to replace it with property from command line properties file.</p>