簡體   English   中英

如何在CXF Maven插件中配置Multiple.wsdl

[英]How to configure Multiple .wsdl in CXF Maven Plugin

在以下示例中,我能夠配置 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>

但我的問題是,如果我有 100 個或更多 WSDL 那么我需要添加 100 個或更多次。

是否有任何通用方法可以在 pom.xml 文件中多次避免這種情況。

<wsdlRoot>元素可以指定為使用多個 wsdl 而無需顯式引用它們。

<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:Usingpatternsdlincludewith

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM