通过命令行替换pom.xml中的Maven属性 [英] Replace Maven properties in pom.xml via command line

查看:815
本文介绍了通过命令行替换pom.xml中的Maven属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过一些Maven插件通过命令行调用替换pom.xml文件中的Maven属性.

I want to replace a Maven property in a pom.xml file with a command line call via some Maven plugin.

<properties>
    <my.property>ISO-8859-1</my.property>
<properties>

您知道一个能够做到这一点的插件吗?

Do you know of a plugin which is able to do that?

版本插件花费很长时间,因为它会检查某些依赖项是否可用.除此之外,在我的情况下它不起作用.

The versions plugin takes very long since it checks whether some dependency is available. Besides that it doesn't work in my case.

推荐答案

您需要做的就是在命令行上运行maven时添加以下内容

All you need to do is add the following when running maven on the command line

-Dmy.property=propertyValue

这篇关于通过命令行替换pom.xml中的Maven属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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