同时,我找到了另一个最适合我需求的解决方案。有一个名为 jaxws-maven-plugin 的 maven 插件,它还能够在从 wsdl 生成源时处理 XMLCatalogs。
https://jax-ws-commons.dev.java.net/jaxws-maven-plugin/
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>1.10</version>
<executions>
<execution>
<id>id1</id>
<phase>generate-sources</phase>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<verbose>true</verbose>
<keep>true</keep>
<catalog>${basedir}/src/main/resources/catalog.xml</catalog>
<packageName>org.example</packageName>
<wsdlDirectory>
${basedir}/src/main/resources/contracts/wsdl/ExampleService/1
</wsdlDirectory>
<wsdlFiles>
<wsdlFile>ExampleService_1_0.wsdl</wsdlFile>
</wsdlFiles>
<xadditionalHeaders>false</xadditionalHeaders>
</configuration>
</execution>
</executions>
<configuration>
</configuration>
<dependencies>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-tools</artifactId>
<version>2.1.7</version>
</dependency>
</dependencies>