【发布时间】:2015-12-14 03:31:43
【问题描述】:
我在 pom.xml 中定义了两个配置文件:
<profiles>
<profile>
<id>nobrand</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<brand>nobrand</brand>
</properties>
</profile>
<profile>
<id>mybrand</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<brand>mybrand</brand>
</properties>
</profile>
</profiles>
<build> 部分仅使用每个配置文件设置的属性。
默认情况下,这两个配置文件都设置为活动状态。但是,只有最后一个是由mvn package 执行的。为什么?我预计构建会执行两次。
【问题讨论】:
标签: maven pom.xml maven-profiles