【发布时间】:2015-11-22 22:21:19
【问题描述】:
我正在尝试使用 Spring Cloud Config Server 来外部化我的 Grails 3(人员)应用程序配置,但我似乎无法设置 dataSource 属性。
目前,我可以将其他属性 (sample.message) 加载到我的 Grails 3(人员)应用程序中,并使用 grailsApplication.config.sample.message 检索它们而不会出现问题。并且在配置服务器(localhost:8888/personnel/master)上点击 REST 端点正在显示我想要的配置信息,所以我有点困惑。
我在我的 Git 存储库中的 personnel.properties 文件中尝试了以下各项:
datasource.user=example
datasource.password=example
grails.datasource.user=example
grails.datasource.password=example
spring.datasource.user=example
spring.datasource.password=example
但它们都不起作用。我继续看到错误消息说sa@localhost (using password: no),特别是表明数据源属性不起作用。
我知道spring-boot-starter-data-jpa 是可能的,所以我想知道:
- GORM 可以吗?
- 如果需要,是否需要手动创建数据源 bean?
- 我使用哪些属性名称
datasource.user、grails.datasource.user、spring.datasource.user等?
【问题讨论】:
标签: grails spring-cloud grails-3.0