maven更新pom属性 [英] maven update pom property

查看:169
本文介绍了maven更新pom属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种将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属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆