title: Spring boot auto-configuration and properties
body: <p>I have 2 modules in my project app &amp; starter. Starter contains <code>@Configuration</code> and tells how a bean of <code>ServiceFoo</code> should be created.</p>
  
  <pre><code>@Configuration
  @EnableConfigurationProperties(FooServiceConfiguration.class)
  public class StarterFoo {
  
      @Bean
      public ServiceFoo defaultBean(FooServiceConfiguration conf){
        new ServiceFooImpl(conf.getName(), conf.getNumber());
      }
  
  }
  </code></pre>
  
  <p>I have another configuration class in my starter.</p>
  
  <pre><code>import org.springframework.boot.context.properties.ConfigurationProperties;
  
  @ConfigurationProperties("Foo")
  public class FooServiceConfiguration {
      private String name;
      private int number;
      // + accessors
  }
  </code></pre>
  
  <p>in my starter I have <code>application.yml</code> which has</p>
  
  <pre><code>Foo:
   name: DefaultName
   number: 101
  </code></pre>
  
  <p>starter is configured to be auto-configured</p>
  
  <p>META-INF/spring.factories</p>
  
  <pre><code>org.springframework.boot.autoconfigure.EnableAutoConfiguration=StarterFoo
  </code></pre>
  
  <p>I want to have opinion on my config about number and user will never worry and override that number. I want users to override name in my config.</p>
  
  <p>As soon as I create application.yml in app (blank file) the effect of starter's config (from application.yml from starter) goes away.</p>
  
  <p>How can I partially override this config from app which is defined in starter ?</p>