【发布时间】:2013-12-18 13:35:44
【问题描述】:
配置:
- Maven:3.0.5
- Java:1.6.0_45
说明:
假设我们有如下配置文件:
<profiles>
<profile>
<id>profile-1</id>
<activation>
<jdk>1.6</jdk>
<property>
<name>name</name>
<value>Hubert</value>
</property>
</activation>
</profile>
<profile>
<id>profile-2</id>
<activation>
<jdk>1.6</jdk>
<property>
<name>name</name>
<value>Wiktoria</value>
</property>
</activation>
</profile>
</profiles>
我们有两个配置文件:profile-1 和 profile-2。
配置文件 profile-1 应在满足两个要求时处于活动状态:
- jdk 是 1.6 版
- 属性 name 具有值 Hubert
问题:
让我们检查一下这个配置:
mvn -Dname=Hubert help:active-profiles
因此,我发现有两个活动配置文件:profile-1 和 profile-2。
嗯...
配置文件 profile-2 不应处于活动状态,因为属性 name 的值与预期的 Wiktoria 不同。
有人能解释一下为什么会这样吗?这是正常行为吗?
谢谢。
【问题讨论】: