我的项目继承的POM包含一些<pluginManagement>
为了release
指定一些额外的插件arguments
.
我的问题是:有没有办法覆盖arguments
在这种情况下来自命令行的参数?
父 POM 具有以下内容:
<pluginManagement>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<arguments>-Prelease</arguments>
</configuration>
</plugin>
</pluginManagement>
由于命令行参数不起作用:
mvn release:prepare -Darguments="-Pmock -Prelease"
The -Darguments="-Pmock -Prelease"
部分没有影响。什么时候arguments
尚未指定,它可以工作。
我不可能修改父 POM 或不使用它。
找到了解决方案。在myPOM 我添加了这个,它将覆盖中的设置parentPOM 并允许在命令行上指定其他参数,例如-Darguments=-Pmock
<pluginManagement>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<arguments>${arguments} -Prelease</arguments>
</configuration>
</plugin>
</pluginManagement>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)