我已经定义了一个@Config
像这样的类:
@Config
@PropertySource(value = "")
public class Foo {
...
}
我通过包含以下内容来运行我的程序:
--spring.config.location=file:///Users/dev/workspace/application.yml
问题是我不能省略 PropertySource 注释的“值”属性。为什么需要设置它?这会覆盖我设置的内容--spring.config.location
吗?我应该使用SimpleCommandLinePropertySource
而不是--spring.config.location
吗?