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

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

        <tfoot id='ic2vr'></tfoot>

      1. <legend id='ic2vr'><style id='ic2vr'><dir id='ic2vr'><q id='ic2vr'></q></dir></style></legend>

        使用 Maven 配置文件构建两个不同的版本并从 Ec

        时间:2023-07-28

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

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

          <legend id='Oltim'><style id='Oltim'><dir id='Oltim'><q id='Oltim'></q></dir></style></legend>
              <tbody id='Oltim'></tbody>
              1. <tfoot id='Oltim'></tfoot>

                  <bdo id='Oltim'></bdo><ul id='Oltim'></ul>
                  本文介绍了使用 Maven 配置文件构建两个不同的版本并从 Eclipse 中过滤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在尝试使用 ma​​ven 配置文件过滤 来生成给定 Web 存档的 两个不同版本(war):

                  I am trying to use maven profiles and filtering in order to produce two different versions of a given web archive (war):

                  1. 第一个 本地部署到我在 localhost 上的本地机器
                  2. 第二个用于远程部署到 cloudfoundry
                  1. A first one for local deployment to my local machine on localhost
                  2. A second one for remote deployment to cloudfoundry

                  根据应用是部署到我的本地计算机还是部署到 cloudfoundry,有许多属性会有所不同.

                  There are a number of properties that differ according to whether the app is deployed to my local machine or to cloudfoundry.

                  当然,困难在于我正在尝试从 STS/Eclipse 完成所有这些操作,并从 Eclipse 部署到我的本地 tomcat 和 cloudfoundry...

                  Of course the difficult bit is that I am trying to do all this from STS/Eclipse and deploy from Eclipse to my local tomcat and to cloudfoundry...

                  谁能提供建议、提示或建议?

                  Can anyone please provide advice, tips or suggestions?

                  推荐答案

                  如果您使用 Spring 版本控制 3.1+,则 spring bean 配置 xml 中 的profile"属性将是最佳选择.看看这里的文档:http://docs.cloudfoundry.com/frameworks/java/spring/spring.html#using-spring-profiles-to-conditionalize-cloud-foundry-configuration

                  If you are using Spring versioning 3.1+ the "profile" attribute for <beans> in the spring bean configuration xml would be the best choice. Take a look at the doc here: http://docs.cloudfoundry.com/frameworks/java/spring/spring.html#using-spring-profiles-to-conditionalize-cloud-foundry-configuration

                  基本上您需要指定至少 2 个元素.一种用于本地属性 (profile="default"),另一种用于部署到 CF 时的属性.后者应该定义为<beans profile="cloud">.在本地运行时,云"中的属性将被忽略,默认"中的属性将生效.推送到 CF 时,CF 会检测名为cloud"的配置文件,更好的是注入 CF 自己提供的服务的相应数据源连接信息.您也可以在该文档中找到详细的 CF 指定属性.

                  Basically you need to specify at least 2 elements. One for your local properties (profile="default") and one for the properties when deployed to CF. The latter one should be defined as <beans profile="cloud">. When running locally the properties within "cloud" would be ignored and properties in "default" will take effect. When pushed to CF, CF will detect the profile named "cloud" and, which is better, inject corresponding datasource connection info of the services provisioned by CF itself. You can find the detailed CF-specified properties in that doc as well.

                  有关配置文件属性的更多信息,请参阅此处的文档:http://blog.springsource.com/2011/02/11/spring-framework-3-1-m1-released/

                  For more information about the profile attribute, see the doc here: http://blog.springsource.com/2011/02/11/spring-framework-3-1-m1-released/

                  这篇关于使用 Maven 配置文件构建两个不同的版本并从 Eclipse 中过滤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:CI环境中Maven项目的GPG密钥在哪里保存? 下一篇:我可以在 Citrus 静态响应适配器有效负载中使用

                  相关文章

                  最新文章

                  <legend id='klDTB'><style id='klDTB'><dir id='klDTB'><q id='klDTB'></q></dir></style></legend>

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

                  1. <tfoot id='klDTB'></tfoot>

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