title: ConfigurationProperties Not Working in Spring Boot2
body: <pre><code>Spring Boot Version 2.1.4 RELEASE
  </code></pre>
  
  <p>I have client jar with a Settings Bean defined as </p>
  
  <pre><code>    @ConditionalOnBean(annotation = Some.class)
      @ConfigurationProperties(prefix = "service")
      @Data
      public class WebserviceSettings  {
        //bunch of Properties
        private String serviceUrl;
        @PostConstruct
        public void init() { if(serviceUrl==null) throw ValidationException("bla") }
      }
  
      Another Config Class
      @ConditionalOnBean(annotation = Some.class)
      @EnableConfigurationProperties(WebserviceSettings.class)
      @Configuration
      public class ClientConfig{ 
         @Bean("webserviceSettings")
         public WebserviceSettings webserviceSettings(){
            return new WebserviceSettings();
         }
      }
  </code></pre>
  
  <p>Client jar is added to spring boot rest service.</p>
  
  <p>The JUNIT Test written for the Client jar works fine and loads up the Bean without any validation Exception coming out of the PostConstruct Method.</p>
  
  <p>Test Class written within the client works!</p>
  
  <pre><code>    @RunWith(SpringRunner.class)
      @SpringBootTest(classes = { ClientTestBootApplication.class })
      @TestPropertySource(properties="spring.config.location=classpath:application-test.yaml")
  </code></pre>
  
  <p>However, when I am loading the Spring Boot Service - it fails to load the Settings bean with ValidationException thrown from PostConstruct Method. </p>
  
  <pre><code>application.yml
   service: 
     url: "bla"
  </code></pre>
  
  <p>It means that when the client is added to services project, it's not loading the property from yaml. How to solve this?</p>
  
  <p>Project Structure</p>
  
  <pre><code>spring-boot-restEasy Application
   - src/main/resources/application-DEV.yml
   --client jar A 
   --client jar B
  </code></pre>
  
  <p>Client jar = [Service Call and some Business Logic], 
  application-DEV.yml Contains Service Settings of Client Jar like url</p>
  
  <pre><code>Exception 
  Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'service-packagName.Settings': Invocation of init method failed; nested exception is ValidationException: [url cannot be Null]
      at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:139)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:414)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1754)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
      at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
      at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1247)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1167)
      at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:857)
      at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:760)
      ... 52 more
  </code></pre>