【发布时间】:2017-01-19 16:15:38
【问题描述】:
我有一个依赖 jar 文件,我已将其添加为依赖项。有没有办法使用依赖 jar 中存在的 application.properties 文件来获取?
【问题讨论】:
标签: java spring spring-boot properties
我有一个依赖 jar 文件,我已将其添加为依赖项。有没有办法使用依赖 jar 中存在的 application.properties 文件来获取?
【问题讨论】:
标签: java spring spring-boot properties
让属性 spring.config.location 指向那个 application.properties 喜欢
spring.config.location=classpath:com/company/whatever/application.properties
启动应用时可以在命令行设置spring.config.location
$ java -jar myproject.jar --spring.config.location=classpath:com/company/whatever/application.properties
spring boot docs 对此进行了解释
【讨论】: