[英]How to configure Multiple .wsdl in CXF Maven Plugin
In the following example i am able to configure WSDL.在以下示例中,我能够配置 WSDL。
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
<wsdlOptions>
<!-- for myService1.wsdl -->
<wsdlOption>
<wsdl>${basedir}/src/main/wsdl/myService1.wsdl</wsdl>
</wsdlOption>
<!-- for myService2.wsdl -->
<wsdlOption>
<wsdl>${basedir}/src/main/wsdl/myService2.wsdl</wsdl>
</wsdlOption>
. . .
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
But my question is what if i have 100 and more WSDL then i need to add it 100 and more times.但我的问题是,如果我有 100 个或更多 WSDL 那么我需要添加 100 个或更多次。
Is there any generic way to avoid this writtig in multiple times in pom.xml file.是否有任何通用方法可以在 pom.xml 文件中多次避免这种情况。
The <wsdlRoot>
element can be specified for using multiple wsdls without needing to explicitly reference them. <wsdlRoot>
元素可以指定为使用多个 wsdl 而无需显式引用它们。
<includes>
can be used to further select the wsdls under <wsdlRoot>
<includes>
可用于进一步 select <wsdlRoot>
下的 wsdls
<configuration>
<sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
<wsdlRoot>${basedir}/src/main/resources/wsdl</wsdlRoot>
<includes>
<include>*Service.wsdl</include>
</includes>
</configuration>
https://cxf.apache.org/docs/maven-cxf-codegen-plugin-wsdl-to-java.html#Mavencxf-codegen-plugin(WSDLtoJava)-Example5:UsingwsdlRootwithincludes/excludespatterns https://cxf.apache.org/docs/maven-cxf-codegen-plugin-wsdl-to-java.html#Mavencxf-codegen-plugin(WSDLtoJava)-Example5:Usingpatternsdlincludewith
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.