<bdo id='rIAV7'></bdo><ul id='rIAV7'></ul>
  • <tfoot id='rIAV7'></tfoot>
  • <i id='rIAV7'><tr id='rIAV7'><dt id='rIAV7'><q id='rIAV7'><span id='rIAV7'><b id='rIAV7'><form id='rIAV7'><ins id='rIAV7'></ins><ul id='rIAV7'></ul><sub id='rIAV7'></sub></form><legend id='rIAV7'></legend><bdo id='rIAV7'><pre id='rIAV7'><center id='rIAV7'></center></pre></bdo></b><th id='rIAV7'></th></span></q></dt></tr></i><div id='rIAV7'><tfoot id='rIAV7'></tfoot><dl id='rIAV7'><fieldset id='rIAV7'></fieldset></dl></div>

    <small id='rIAV7'></small><noframes id='rIAV7'>

  • <legend id='rIAV7'><style id='rIAV7'><dir id='rIAV7'><q id='rIAV7'></q></dir></style></legend>

        application.yml 是否支持环境变量?

        时间:2023-09-26

          <i id='DpS5D'><tr id='DpS5D'><dt id='DpS5D'><q id='DpS5D'><span id='DpS5D'><b id='DpS5D'><form id='DpS5D'><ins id='DpS5D'></ins><ul id='DpS5D'></ul><sub id='DpS5D'></sub></form><legend id='DpS5D'></legend><bdo id='DpS5D'><pre id='DpS5D'><center id='DpS5D'></center></pre></bdo></b><th id='DpS5D'></th></span></q></dt></tr></i><div id='DpS5D'><tfoot id='DpS5D'></tfoot><dl id='DpS5D'><fieldset id='DpS5D'></fieldset></dl></div>
        1. <tfoot id='DpS5D'></tfoot>
        2. <legend id='DpS5D'><style id='DpS5D'><dir id='DpS5D'><q id='DpS5D'></q></dir></style></legend>

            <bdo id='DpS5D'></bdo><ul id='DpS5D'></ul>

                <small id='DpS5D'></small><noframes id='DpS5D'>

                    <tbody id='DpS5D'></tbody>
                  本文介绍了application.yml 是否支持环境变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我尝试在 application.yml 配置中使用环境变量,例如:

                  I tried using env variables in my application.yml configration like:

                  spring:
                    main:
                      show_banner: false
                  
                  ---
                  
                  spring:
                    profiles: production
                  server:
                    address: $OPENSHIFT_DIY_IP
                    port: $OPENSHIFT_DIY_PORT
                  

                  但是环境变量没有被解析.我必须提供不同的符号吗?

                  but the env variables are not resolved. Do I have to provide a different notation?

                  在 Rails 中,您可以例如使用 <%= ENV['FOOVAR'] %>

                  In Rails you can e.g. use <%= ENV['FOOVAR'] %>

                  唯一的选择是像这样运行应用程序:

                  The only alternative is to run the app like:

                  java -jar my.jar --server.address=$OPENSHIFT_DIY_IP --server.port=$OPENSHIFT_DIY_PORT
                  

                  推荐答案

                  试试 ${OPENSHIFT_DIY_PORT}(通常的 Spring 占位符符号).请参阅此处了解文档.

                  Try ${OPENSHIFT_DIY_PORT} (the usual Spring placeholder notation). See here for docs.

                  这篇关于application.yml 是否支持环境变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:使用@Query 从 SPRING BOOT 中的文件中获取查询 下一篇:Spring Boot:从 YAML 文件加载 @Value

                  相关文章

                  最新文章

                  1. <tfoot id='vy9W6'></tfoot>
                  2. <small id='vy9W6'></small><noframes id='vy9W6'>

                      <i id='vy9W6'><tr id='vy9W6'><dt id='vy9W6'><q id='vy9W6'><span id='vy9W6'><b id='vy9W6'><form id='vy9W6'><ins id='vy9W6'></ins><ul id='vy9W6'></ul><sub id='vy9W6'></sub></form><legend id='vy9W6'></legend><bdo id='vy9W6'><pre id='vy9W6'><center id='vy9W6'></center></pre></bdo></b><th id='vy9W6'></th></span></q></dt></tr></i><div id='vy9W6'><tfoot id='vy9W6'></tfoot><dl id='vy9W6'><fieldset id='vy9W6'></fieldset></dl></div>
                    1. <legend id='vy9W6'><style id='vy9W6'><dir id='vy9W6'><q id='vy9W6'></q></dir></style></legend>
                        <bdo id='vy9W6'></bdo><ul id='vy9W6'></ul>