title: JSR-303 annotations do not validate bean properties when Spring Boot application starts
body: <p>I require a properties bean to be validated at start up time and for the application to fail to start should validation fail.</p>
  
  <p>I have a bean which contains configuration provided by environment variables:</p>
  
  <pre><code>@Component
  public class AdminConfig
  {
      @NotNull( message = "username can't be null")
      @NotEmpty( message = "username can't be empty")
      @Value(value="#{environment.username}")
      /** username to the admin portal **/
      private String username;
  
      @NotNull(message = "password can't be null")
      @NotEmpty(message = "password can't be empty")
      @Value(value="#{environment.password}")
      /** password to the admin portal **/
      private String password;
  }
  </code></pre>
  
  <p>and I have a driver class:</p>
  
  <pre><code>/**
   * Driver class.
   */
  @EnableAutoConfiguration
  public class Main {
  
      /**
       * Driver method.
       * @param args Command line arguments.
       */
      public static void main(final String[] args)  {
          SpringApplication.run(Main.class, args);
  
      }
   }
  </code></pre>
  
  <p>and I have the following POM entries:</p>
  
  <pre><code>&lt;dependencies&gt;
          &lt;!-- Spring --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
              &lt;version&gt;2.0.0.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- Validation annotations --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-validation&lt;/artifactId&gt;
              &lt;version&gt;2.0.0.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>When I start the application without setting the environment variables, the <code>AdminConfig</code> bean is created <strong>but the validation does not fire</strong> and  the application starts.</p>
  
  <p>I expect/require the application to fail to start because of validation failures.</p>