我正在尝试将 bootstrap.properties
从我的 jar 外部放入,这样它就不会被其他开发人员错误地覆盖。你能在这里给点建议吗?
这是它的内容——指向 spring 服务器配置
# application name
spring.application.name=elixium
# The server entry point
spring.cloud.config.uri=http://localhost:8888
最佳答案
Spring Cloud 使用相同的 locations as spring boot找到 bootstrap.properties
(或 .yml
)。所以classpath:,classpath:/config,file:,file:config/
是默认搜索路径,./config/
是最高优先级。如果您的文件位于 ./config
或 ./
中,它应该可以正常工作。属性(spring.cloud.bootstrap.location
)为change the location与引导略有不同。
关于java - spring cloud - 我的 jar 外的 bootstrap.properties,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36763192/