当前位置: 动力学知识库 > 问答 > 编程问答 >

spring boot - Is it possible to have database properties outside of any property file in Intellij

问题描述:

I want to ask is it possible to have database properties outside of any property file now I have database properties inside dbconfig.properties but I want to have it be supplied from outside passing as an argument for example.

Is there any suggestion to have this approach.

网友答案:

I would follow the documentation:

24.2 Accessing command line properties:

By default SpringApplication will convert any command line option arguments (starting with ‘--’, e.g. --server.port=9000) to a property and add it to the Spring Environment. As mentioned above, command line properties always take precedence over other property sources.

分享给朋友:
您可能感兴趣的文章:
随机阅读: