Maven:不同配置文件的不同属性文件(Maven: Different property files for different profiles)

您所在的位置:网站首页 maven打包不同的环境 Maven:不同配置文件的不同属性文件(Maven: Different property files for different profiles)

Maven:不同配置文件的不同属性文件(Maven: Different property files for different profiles)

2023-03-26 05:09| 来源: 网络整理| 查看: 265

我正在使用不同的maven配置文件将我的应用程序部署到不同的环境。 (使用weblogic-maven-plugin,但我认为这并不重要)

在应用程序中,我使用Spring Web Services。 现在我想根据环境更改端点。 (端点在Spring的applicationContext.xml中定义)

我的想法是从属性文件中读取值。 在Mavens包阶段,将写入(或复制)此属性文件。

这是一个好主意吗?

如果是:如何使用maven创建此属性(或整个文件)。

如果不是:什么是更好的方法来解决这个问题?

I'm using different maven profiles to deploy my application to different environments. (With the weblogic-maven-plugin, but I think this is not important)

In the application I use Spring Web Services. Now I'd like to change the endpoint depending on the environment. (The endpoint is defined in Spring's applicationContext.xml)

My idea is to read the value from a property file. This property file will be written (or copied) during Mavens package phase.

Is this a good idea?

If yes: How do I create this property (or the whole file) with maven.

If no: What would be a better aproach to solve this problem?



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3