title: SpringBoot Failed to bind properties under app
body: <p>I have a SpringBoot 2.1.7.RELEASE project with gradle. I'm getting an error when I try to use @ConfigurationProperties</p>
  
  <p>The property that I'm trying to bind is existing in my application-default.properties and if I run the project using Itellij I can see that the property is ingested in my component.</p>
  
  <p>If I enable @EnableConfigurationProperties I got an error.</p>
  
  <p>My application-default.properties</p>
  
  <pre><code>app.forwarding-endpoint=localhost:8080
  </code></pre>
  
  <p>My AppProperties.java</p>
  
  <pre><code>@ConfigurationProperties(prefix = "app", ignoreUnknownFields = false)
  @Validated
  @Data
  public class AppProperties {
     @NotBlank
     @Pattern(regexp = "^(.+):\\d+$")
     private String forwardingEndpoint;
  }
  </code></pre>
  
  <p>My Application.java</p>
  
  <pre><code>@SpringBootApplication
  @EnableConfigurationProperties(AppProperties.class)
  public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application .class, args);
    }
  }
  </code></pre>
  
  <p>My component that is using the property:</p>
  
  <pre><code> public MyComponent(@Value("${app.forwarding-endpoint}") String forwardingEndpoint) {
      log.info("Forwarding endpoint {}", forwardingEndpoint);
   }
  </code></pre>
  
  <p>The error that I get is:</p>
  
  <pre><code>Binding to target org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'app' to com.config.AppProperties failed:
  
  Property: app.forwardingEndpoint
  Value: null
  Reason: must not be blank
  </code></pre>
  
  <p>What am I missing?</p>