在maven 2中的命令行上设置插件的属性 [英] Set plugin's property on the command line in maven 2

查看:99
本文介绍了在maven 2中的命令行上设置插件的属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在maven 2.x中,如何在命令行上设置插件的属性,而不是在< configuration>

In maven 2.x, how would one set a plugin's property on the command line instead of in the <configuration> of that plugin in the pom or in settings.xml?

例如,如果我使用 mvn dependency:copy-dependencies 见这里)如何我可以设置useRepositoryLayout属性而不触及pom或我的settings.xml?

For example, if I was using mvn dependency:copy-dependencies(seen here) how can I set the useRepositoryLayout property without touching either the pom or my settings.xml?

谢谢!

推荐答案

答案是在我面前的副本依赖mojo docs(我甚至链接到它)。

Answer was right in front of me in the copy-dependencies mojo docs (I even linked to it). The documentation for the property includes the Expression you can refer to it by.


useRepositoryLayout:将每个
artifact放在同一个目录下layout
作为默认存储库。示例:
/outputDirectory/junit/junit/3.8.1/junit-3.8.1.jar

useRepositoryLayout: Place each artifact in the same directory layout as a default repository. example: /outputDirectory/junit/junit/3.8.1/junit-3.8.1.jar

* Type: boolean
* Since: 2.0-alpha-2
* Required: No
* Expression: ${mdep.useRepositoryLayout}
* Default: false


要从命令行设置此属性,您需要运行

To set this property from command line you need to run

mvn -Dmdep.useRepositoryLayout=true <goals go here>

这篇关于在maven 2中的命令行上设置插件的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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