从Maven传递命令行参数作为pom.xml中的属性 [英] Passing command line arguments from Maven as properties in pom.xml
本文介绍了从Maven传递命令行参数作为pom.xml中的属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以将命令行参数传递给pom.xml
文件中的属性?
例如我运行mvn ... argument
Is it possible to pass arguments from command line to properties in pom.xml
file ?
for example I run mvn ... argument
和pom.xml
<properties>
<myproperty> here should add argument from command line</myproperty>
</properties>
谢谢您的帮助.
推荐答案
对于您的媒体资源示例,请执行以下操作:
For your property example do:
mvn install "-Dmyproperty=my property from command line"
注释引号包含整个属性定义.如果您的媒体资源包含空格,则将需要它们.
Note quotes around whole property definition. You'll need them if your property contains spaces.
这篇关于从Maven传递命令行参数作为pom.xml中的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文