【发布时间】:2020-07-11 04:48:33
【问题描述】:
我正在构建一个 spring boot 应用程序,application.properties 值可以从另一个属性中获取
我有一个这样的 application.properties
spring.datasource.url= jdbc:oracle:thin:@//localhost:1521/test
org.quartz.dataSource.qDS.URL=jdbc:oracle:thin:@//localhost:1521/ORCL
Spring boot 可以这样吗?
db.connections.url=jdbc:oracle:thin:@//localhost:1521/test
spring.datasource.url= db.connections.url
org.quartz.dataSource.qDS.URL=db.connections.url
【问题讨论】:
-
您是指其他属性值还是其他属性文件?
-
否,但在同一个属性文件中。但是如果不可以的话,从另一个文件中读取是可以的,只要在java类中没有配置即可。
标签: java spring spring-boot