在maven中,CXF自动生成失败并显示“Duplicated option:frontend”?

问题描述 投票:2回答:1

我已经从WSDL文件中设置了一个简单的cxf maven auto generation。但我得到以下例外。我错过了什么?

执行生成目标org.apache.cxf:cxf-codegen-plugin:3.0.0:wsdl2java失败:org.apache.cxf.tools.common.toolspec.parser.BadUsageException:重复选项:frontend(org.apache。 CXF:CXF-CODEGEN-插件:3.0.0:WSDL2Java的:产生来源:产生来源)

pom.hml:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-codegen-plugin</artifactId>
            <version>3.0.0</version>
            <executions>
                <execution>
                    <id>generate-sources</id>
                    <phase>generate-sources</phase>

                    <configuration>
                      <defaultOptions>
                          <extraargs>
                              <extraarg>-fe</extraarg>
                              <extraarg>cxf</extraarg> 
                          </extraargs>
                      </defaultOptions>
                        <wsdlOptions>
                            <wsdlOption>
                                <wsdl>${project.basedir}/src/main/resources/MyService.wsdl</wsdl>
                                <wsdlLocation>classpath:/MyService.wsdl</wsdlLocation>
                            </wsdlOption>
                        </wsdlOptions>
                    </configuration>
                    <goals>
                        <goal>wsdl2java</goal>
                    </goals>
                </execution>
            </executions>


                 </plugin>
        </plugins>
    </build>
    <dependencies>

            <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-frontend-jaxws</artifactId>
                <version>3.0.0</version>
            </dependency>
 <dependencies>

Maven调试显示以下内容:

[DEBUG]用args调用wsdl2java:[-encoding,UTF-8,-d,\ target \ generated \ src \ main \ java,-fe,cxf,-fe,cxf,-wsdlLocation,classpath:wsdl / MyService.wsdl ...

为什么前端qazxsw poi创造了两次?

java web-services maven soap cxf
1个回答
4
投票

删除-fe部分。

在wsdlOption中添加此extraarg

<extraargs><extraarg>-fe</extraarg><extraarg>cxf</extraarg></extraargs>
© www.soinside.com 2019 - 2024. All rights reserved.