我在项目中使用父 POM 和子 POM:
父 POM:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-xjc-plugin</artifactId>
<executions>
<execution>
...
<configuration>
...
<xsdOptions>
<xsdOption>
<extensionArgs>
<extensionArg>-XNullable</extensionArg>
<arg>-encoding</arg>
<arg>UTF-8</arg>
</extensionArgs>
</xsdOption>
</xsdOptions>
</configuration>
</execution>
</executions>
</plugin>
</pluginManagement>
Run Code Online (Sandbox Code Playgroud)
我在子 POM 中的目标是消除该<extensionArg>-XNullable</extensionArg>参数。
我尝试使用以下combine.self="override"属性:
<build>
<plugins>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-xjc-plugin</artifactId>
<configuration>
<xsdOptions>
<xsdOption>
<extensionArgs combine.self="override">
<arg>-encoding</arg>
<arg>UTF-8</arg>
</extensionArgs>
</xsdOption>
</xsdOptions>
</configuration>
</plugin>
</plugins>
</build>
Run Code Online (Sandbox Code Playgroud)
但这行不通。有效的配置仍然是:
<xsdOptions>
<xsdOption>
<extensionArgs combine.self="override">
<extensionArg>-XNullable</extensionArg>
<arg>-encoding</arg>
<arg>UTF-8</arg>
</extensionArgs>
</xsdOption>
</xsdOptions>
Run Code Online (Sandbox Code Playgroud)
有什么想法如何<extensionArg>-XNullable</extensionArg>在 Maven 合并过程中从配置中删除吗?
Maven:3.3.3
在您的父 POM 中,您将添加到<extensionArg>-XNullable</extensionArg>插件特定执行的配置中(在<execution>tag 元素内)。但是,在您的子 POM 中,您将覆盖常规配置(即不特定于任何执行的配置)。
因此,该特定执行的配置不会被覆盖。您需要将子 POM 中的插件配置移至特定执行中。另一种可能性是将父 POM 的配置移至通用配置,而不是特定于执行的配置。
| 归档时间: |
|
| 查看次数: |
6818 次 |
| 最近记录: |