星空网 > 软件开发 > Java

一种更好的方式设置maven pom 缺省激活的 profile

maven  profiles, 缺省激活一个 profile 有两种方式:

方式1:

<activation>  <activeByDefault>true</activeByDefault></activation>

方式2:

<activation>  <property>!Foo<property></activation>

方式1的问题是只要显示指定了其他的profile, 那缺省的这个就被停用了。

对于方式2, 只要 Foo 属性没有设置,它一直是激活的。

借助于方式2 , 我们可以同时设置多个缺省激活的 profile. 同时我们可以在命令行禁用它们, 通过:

mvn   -P!aProfile     — 在 profile id 前加 ! 

或:

mvn   -DFoo    — 设置Foo 属性 。 

除非缺省激活的 profile 与所有其他的 profile 互斥(这种情况比较少),其他情况使用方式2显然更灵活。 

 

 




原标题:一种更好的方式设置maven pom 缺省激活的 profile

关键词:maven

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

iStock:https://www.goluckyvip.com/tag/21614.html
ist空运:https://www.goluckyvip.com/tag/21615.html
It Flips:https://www.goluckyvip.com/tag/21616.html
Italic:https://www.goluckyvip.com/tag/21617.html
Itaú:https://www.goluckyvip.com/tag/21618.html
ITC Ltd:https://www.goluckyvip.com/tag/21619.html
23点聊电商:新质生产力加速数字贸易发展 卓尔智联集团实现营收利润双增长 :https://www.kjdsnews.com/a/1836411.html
南京浦口都有什么好玩的地方 南京浦口都有什么好玩的地方推荐:https://www.vstour.cn/a/363180.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流