【发布时间】:2011-11-26 03:38:11
【问题描述】:
在我的项目中有 2 个配置文件,每个配置文件都有一个属性。 但是我不能在孩子的资源中使用主人的属性。
这里描述的很清楚,但是好像只有一个pom文件,并且那里显示的示例不是多模块maven项目。
我想要做的就是在 spring 级别使用这个属性,比如更改属性文件的位置。
<profile>
<id>p1</id>
<properties>
<properties.location>file:/apps-core1.properties</properties.location>
</properties>
</profile>
<profile>
<profile>
<id>p2</id>
<properties>
<properties.location>file:/apps-core2.properties</properties.location>
</properties>
</profile>
<profile>
我想在我拥有的每个 pom 文件中使用“properties.location”,无论是主资源还是测试资源。
这里是spring的用法
<context:property-placeholder location="\${properties.location}" />
【问题讨论】:
标签: spring maven properties profile