【发布时间】:2014-06-16 13:08:30
【问题描述】:
我正在开发一个使用 CXF 生成 SOAP 客户端的 SOA 项目。
我需要使用cxf-xjc-boolean 插件来处理推土机映射和布尔属性,所以我遵循http://cxf.apache.org/docs/maven-cxf-codegen-plugin-wsdl-to-java.html 的文档,现在我有以下pom.xml 摘录:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
...
<build>
<plugins>
<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>${basedir}/src/main/java</sourceRoot>
<defaultOptions>
<frontEnd>jaxws21</frontEnd>
</defaultOptions>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/wsdl/My.wsdl</wsdl>
<wsdlLocation>classpath:wsdl/My.wsdl</wsdlLocation>
<extraargs>
<extraarg>-xjc-Xboolean</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
...
<dependency>
<groupId>org.apache.cxf.xjcplugins</groupId>
<artifactId>cxf-xjc-boolean</artifactId>
<version>2.7.0</version>
</dependency>
</dependencies>
</project>
当我运行 generate-sources 目标时(通过 m2e Eclipse 插件或命令行),我收到此错误:
[ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-plugin:2.7.3:wsdl2java (generate-sources) on project My-BL: Execution generate-sources of goal org.apache.cxf:cxf-codegen-plugin:2.7.3:wsdl2java failed: XJC reported 'BadCommandLineException' for -xjc argument:-extension -Xts -target 2.1
如何修复我的 pom.xml 以使 plunig 正常工作?
顺便说一句,我注意到插件的 2.7.3 版本(与我正在使用的 CXF 版本一致的托管插件)在存储库中不可用,所以我使用的是 2.7.0。这可能是个问题吗?
【问题讨论】: