问题描述
我正在寻找一种将pom属性更新为给定值的方法,即我的pom.xml包含:
I'm looking for a way to update pom property to given value, i.e. my pom.xml contains:
<properties>
<abc.def>aaaaa</abc.def>
<properties>
现在我要打电话:
mvn some_plugin:some_goal -Dabc.def=XYZ
最后我的pom.xml应该看起来像
and finally my pom.xml should looks like
<properties>
<abc.def>XYZ</abc.def>
<properties>
我正在阅读有关maven-release-plugin&版本-maven-plugin,但我看不到任何匹配的目标.
I was reading about maven-release-plugin & versions-maven-plugin but i do not see there any matching goal.
在此先感谢您的答复.
推荐答案
mvn versions:update-properties -Dproperties=[XYZ] -DincludeProperties={abc.def}
Read more here.and here.
简而言之:
在版本-maven-plugin中,update-properties
目标将属性设置为特定工件的最新版本.
In versions-maven-plugin, the update-properties
goal sets properties to the latest versions of specific artifacts.
includeProperties
是用逗号分隔的要更新的属性列表.
includeProperties
is a comma separated list of properties to update.
properties
是适用于特定属性的所有限制.
properties
are any restrictions that apply to specific properties.
这篇关于maven更新pom属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!