简体   繁体   English

eclipse 没有使用 application.yml

[英]eclipse is not using application.yml

application.yml应用.yml

server:
   port: 9001

application.properties应用程序.properties

server.port= 9001

code works when I use.properties file but when I am using.yml file no properties are set and it runs on default port 8080. kindly help me with this issue当我使用 .properties 文件时代码有效,但是当我使用 .yml 文件时没有设置任何属性并且它在默认端口 8080 上运行。请帮助我解决这个问题

Application.yml is required to be on root of your application. Application.yml 需要位于应用程序的根目录中。 So it seems eclipse is not finding it on root.所以似乎 eclipse 没有在 root 上找到它。 Try changing the working directory in your eclipse run configuration.尝试更改 eclipse 运行配置中的工作目录。 For example it can be /target/classes例如它可以是 /target/classes

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM