Spring 和 spring.config.location

Spring with spring.config.location

我正试图指向外部配置文件的路径,如下所示:

--spring.config.location=file: C:/Users/some_user/workspace/repository1/payment-api/payment.yml

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

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

的绝对文件

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