我想避免使application.properties
文件杂乱无章,这比我认为在单独的文件中更好。application.properties
应该类似于
@include module1.properties
@include module1.properties
...
###################################
######### Spring Misc #############
###################################
# Direct log to a log file
logging.file=/tmp/kmp-manager.log
#local listening port
server.port=8082
spring.profiles=nr_dev nr_testing production
spring.profiles.active=production
spring.datasource.platform=postgresql
java.security.egd=file:/dev/./urandom
这完全有可能吗?
如果没有,那么避免困惑的明智方法是什么?
最佳答案
Spring Boot Spring Boot 2.4添加了导入功能
现在,我们可以使用spring.config.import=developer.properties
导入其他文件。查看此blog帖子以获取更多详细信息
关于spring - 有没有一种方法可以将属性文件包含在另一个属性文件中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39616176/