带有spring.config.location的Spring

use*_*733 1 spring config spring-boot

我试图指向这样的外部配置文件的路径:

--spring.config.location=file: C:/Users/some_user/workspace/repository1/payment-api/payment.yml
Run Code Online (Sandbox Code Playgroud)

而且不起作用。知道为什么吗?

Ste*_*oll 5

正确的前缀是file://。在Windows上,如果文件URL带有驱动器前缀是绝对的,则需要在文件URL中添加一个额外的“ /”

试试吧file:///C:/Users/some_user/workspace/repository1/payment-api/payment.yml