title: Spring Boot using Yaml instead of properties file
body: <p>I use Spring Boot.
  I would like to write my configuration using  YAML instead of properties.</p>
  
  <p>Since I use <code>spring-boot-starter</code> the SnakeYAML library is already in the classpath, and SpringApplication should use the YAML version automatically.</p>
  
  <blockquote>
    <p>The SpringApplication class will automatically support YAML as an
    alternative to properties whenever you have the SnakeYAML library on
    your classpath.</p>
  </blockquote>
  
  <p>The problem is that the application keep using the application.properties file and if I remove it no configuration are loaded at all.</p>
  
  <p>Can someone help me? this is my main file</p>
  
  <pre><code>@SpringBootApplication
  public class App {
  
  
      public static void main(String[] args) throws Exception {
          SpringApplication app = new SpringApplication(App.class);
          app.setBannerMode(Banner.Mode.OFF);
          app.run(args);
      }
  }
  </code></pre>
  
  <p>this is my <code>pom.xml</code></p>
  
  <pre><code>....
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;1.4.0.RELEASE&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j&lt;/artifactId&gt;
              &lt;version&gt;1.2.17&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>the application.yml file is just </p>
  
  <pre><code>tasks: 231232
  </code></pre>
  
  <p>and I try reading the property using the injected environment</p>
  
  <pre><code>     @Autowired
        private  Environment environment;
  
  ....
  
          log.info(environment.getProperty("tasks"));
  </code></pre>
  
  <p>Where is my mistake?</p>