title: Spring boot @ConfigurationProperties not loaded
body: <p>As the title says, I'm trying to use <a href="http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html#boot-features-external-config-typesafe-configuration-properties" rel="noreferrer">Typesafe Configuration Properties</a> to load a list of <code>DataSourceConfig</code> objects. I have lombok for setter/getters</p>
  
  <p>The main application class annotations</p>
  
  <pre><code>@Slf4j
  @SpringBootApplication
  @EnableConfigurationProperties
  public class Application {
  </code></pre>
  
  <p>The configuration pojo</p>
  
  <pre><code>@Data
  public class DataSourceConfig {
      private String key;
      private String dbname;
      private String dbpath;
  }
  </code></pre>
  
  <p>The yml file</p>
  
  <pre><code>tenantdb:
      dataSourceConfig:
          -
              key: default 
              dbpath: file:eventstore/jdbc/database
              dbname: defaultdb
          -
              key: other
              dbpath: file:eventstore/jdbc/other
              dbname: dslfjsdf
  </code></pre>
  
  <p>Finally, the Spring Configuration class with the @ConfigurationProperties annotation.</p>
  
  <pre><code>@Configuration
  @Profile("hsqldb")
  @ImportResource(value = { "persistence-config.xml" })
  @Slf4j
  @ConfigurationProperties(prefix="tenantdb", locations={"datasources.yml"})
  public class HsqlConfiguration {
  
  
      private List&lt;DataSourceConfig&gt; dataSourceConfig = new ArrayList&lt;&gt;();
  
      @Bean
      public List&lt;DataSourceConfig&gt; getDataSourceConfig() {
          return dataSourceConfig;
      }
  </code></pre>
  
  <p>With the config above, I get:</p>
  
  <pre><code>Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hsqlConfiguration': Could not bind properties to [unknown] (target=tenantdb, ignoreInvalidFields=false, ignoreUnknownFields=true, ignoreNestedProperties=false); nested exception is java.lang.NullPointerException
      at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindingPostProcessor.java:303)
      at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindingPostProcessor.java:250)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initia
  </code></pre>
  
  <p>I've tried various combinations. If I change the annotation to <code>@ConfigurationProperties(prefix="tenantdb.dataSourceConfig")</code>, I don't get the error but <code>List&lt;DataSourceConfig&gt;</code> is empty. </p>
  
  <p>HELP!!</p>