【发布时间】:2018-09-17 05:48:30
【问题描述】:
我有以下部署结构:
├── bin
│ ├── stop.sh
│ └── start.sh
├── config
│ ├── application-dev.properties
│ ├── application-local.properties
│ ├── application.properties
│ └── logback.xml
├── lib
├── myjar.jar
|__ logs
....
我的启动脚本是这样的:
jar -jar ../lib/myjar.jar --spring.profiles.active=dev --spring.config.location=file:./../config/
活动配置文件被拾取,但似乎 spring.config.location 被忽略并从打包的 jar 中获取。
我在这里阅读了有关外部配置的所有信息 - https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html,但我尝试了一些变体,包括类路径,例如)
--spring.config.location=file:./../config/,classpath:/
但这只是行不通。我也尝试过使用 -D 选项,但这也不起作用。
感谢您的帮助
【问题讨论】:
标签: java spring spring-boot