Can´t change port with application.yml file, but it works in application.properties

In a Spring Boot application, when i change my server port in application.properties

server.port=9001

it works perfectly. But when i try to use application.yml

server:
  port : 9001

The port stay as 8080. I use eclipse. What could be the problem ?

Answer

Spring Documentation

The SpringApplication class will automatically support YAML as an alternative to properties whenever you have the SnakeYAML library on your classpath.

Do you have SnakeYAML in your classpath?