我已经从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创造了两次?
删除-fe
部分。
在wsdlOption中添加此extraarg
<extraargs><extraarg>-fe</extraarg><extraarg>cxf</extraarg></extraargs>