简体   繁体   English

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

[英]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.

相关问题 如何配置axis2-java2wsdl-maven-plugin以使用多个类来生成一个wsdl? - How do I configure axis2-java2wsdl-maven-plugin to use multiple classes to generate one wsdl? Maven cxf-codegen-plugin并在wsdl中导入 - Maven cxf-codegen-plugin and import in wsdl 使用Maven和cxf-codegen-plugin将JAR中的WSDL客户端打包 - Packaging WSDL clients in JARs with Maven and cxf-codegen-plugin 如何在maven中使用带通配符的CXF wsdl客户端生成? - How to use CXF wsdl client generation with wildcards in maven? 如何配置Maven Checkstyle插件以允许一行上进行多个分配? - How to configure maven checkstyle plugin to allow for multiple assignments on a line? 如何为具有Maven插件的多个值的参数配置默认值 - How to configure defaults for a parameter with multiple values for a Maven plugin 如何在一次执行下使用 Apache CXF 代码生成插件为 Maven 生成多个服务的源 - How to generate sources for multiple services using Apache CXF codegen plugin for Maven under one execution 为什么 cxf-codegen maven 插件无法在 OpenJDK 10 上运行 wsdl2java 目标? - Why does the cxf-codegen maven plugin fail to run the wsdl2java goal on OpenJDK 10? 如何在Maven插件上配置File []? - How to configure File[] on Maven plugin? 使用CXF从Maven生成WSDL2Java - Generating WSDL2Java from Maven with CXF
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM