mem*_*und 4 java soap web-services cxf maven
我已经从文件设置了一个简单的 cxf maven 自动生成WSDL。但我得到以下异常。我缺少什么?
目标 org.apache.cxf:cxf-codegen-plugin:3.0.0:wsdl2java 的执行生成源失败:org.apache.cxf.tools.common.toolspec.parser.BadUsageException:重复选项:前端 (org.apache. cxf:cxf-codegen-plugin:3.0.0:wsdl2java:生成源:生成源)
pom.xml:
<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>
Run Code Online (Sandbox Code Playgroud)
Maven 调试显示以下内容:
[调试] 使用参数调用 wsdl2java:[-encoding, UTF-8, -d, \target\ generated\src\main\java, -fe, cxf, -fe, cxf, -wsdlLocation, classpath:wsdl/MyService.wsdl ,...
为什么前端-fe创建了两次?
小智 5
删除该<extraargs><extraarg>-fe</extraarg><extraarg>cxf</extraarg></extraargs>部分。
在 wsdlOption 中添加这个额外参数
<wsdlOption>
<extraarg>-autoNameResolution</extraarg>
</wsdlOption>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4164 次 |
| 最近记录: |