简体   繁体   English

Spring Boot Config Server属性文件名

[英]Spring Boot Config Server Property File Name

I want load application properties using spring boot config server using file system. 我想使用使用文件系统的spring boot config服务器加载应用程序属性。 I am able to read config files like {appname}{profile}.properties using my code. 我可以使用自己的代码读取{appname} {profile} .properties等配置文件。 But as per the requirement I need to read properties files with the file name as {appname}.properties.{profile}. 但是根据要求,我需要读取属性文件,其文件名为{appname} .properties。{profile}。 I want to know is there any way around to resolve this problem? 我想知道有什么方法可以解决这个问题吗?

One way is to run your app by specifying the renamed properties file as an argument 一种方法是通过将重命名的属性文件指定为参数来运行您的应用程序

java -jar {your_app.jar} --spring.config.name={your_app_properties_filename}

so something like 所以像

java -jar App.jar --spring.config.name=App.properties.prod

where 哪里

appname=App, profile=prod

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM