如果在我的maven项目的父pom.xml中,它具有如下所示的属性:
<properties>
<argLine>some args</argLine>
</properties>
是否有可能在孩子中以某种方式“增强”,例如
<properties>
<argLine>${parent.argLine} some more args</argLine>
</properties>
类似地说,插件设置,例如
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${parent.plugin.maven-surefire-plugin.argLine} -Xmx1G</argLine>
</configuration>
我基本上只是添加到父项中指定的某些设置?
这个问题的动力是我想知道如何使用jacoco插件,例如,在root pom中指定“ -Xmx1G”,而在子级中可以添加其他参数。参考:https://stackoverflow.com/a/29975159/32453
[我想我可以重命名jacoco生成的参数(https://stackoverflow.com/a/25571295/32453“ propertyName”),然后可以使用父级的$ {argLine}并将其添加到jacococ中,但是我的问题仍然存在。
${argLine}
duplicate父级中的参数。
所以父母:<properties>
<argLine>some args</argLine>
<parentArgLine>some args</parentArgLine>
</properties>
然后使用
<properties> <argLine>${parentArgLine} some child args</argLine>
在儿童中。在我的特定情况下,问题是插件“覆盖”了一个maven变量。