[Solved] Spring Boot Startup Error: Failed to load property source from location ‘classpath:/application-dev.yml‘

Application.yml file format problem

If your project has no configuration errors and the configuration file name is normal, and you still have this problem, it must be a problem with the encoding of your yml file.

Because the encoding format of this file is GBK, the encoding format of the project is UTF-8, there are comments in it, and the comments are garbled, which leads to compilation failure.

Solution:

IDEA open path: File –> Settings –> File Encodings, then change the format of /application.yml to the same as the project, i.e.: UTF-8.
To be on the safe side, change “Project Encoding” to UTF-8 as well.
Restart IDEA, then start the project, OK.

Translated with www.DeepL.com/Translator (free version)

Read More: