Eclipse 使用cxf codegen插件生成失败
我将一个带有模块的现有项目导入到eclipse中,这是由第三方创建的现有代码,我需要尝试并理解这些代码。但有一个项目在mvn clean install上失败,并且以下错误不断发生;这似乎与Web服务问题有关:Eclipse 使用cxf codegen插件生成失败,eclipse,maven,dependencies,Eclipse,Maven,Dependencies,我将一个带有模块的现有项目导入到eclipse中,这是由第三方创建的现有代码,我需要尝试并理解这些代码。但有一个项目在mvn clean install上失败,并且以下错误不断发生;这似乎与Web服务问题有关: ERROR] Failed to execute goal org.apache.cxf:cxf-codegen- plugin:2.7.6:wsdl2java (xxxxxxxxxx) on project xxxxxxxxxx: com/sun/tools/xjc/Bad
ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-
plugin:2.7.6:wsdl2java (xxxxxxxxxx) on project
xxxxxxxxxx:
com/sun/tools/xjc/BadCommandLineException:
com.sun.tools.xjc.BadCommandLineException -> [Help 1]
这是一个使用Web服务验证凭据的用户安全项目。如果您为Maven和“打印异常堆栈跟踪”激活“调试”模式,并且错误是BadCommandLineException的NoClassDefFoundError,那么我通过提供对cxf codegen插件的依赖性来解决它:
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
...
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-xjc</artifactId>
<version>2.4.0-b180725.0644</version>
</dependency>
</dependencies>
</plugin>
org.apache.cxf
cxf-codegen插件
${cxf.version}
...
com.sun.xml.bind
jaxbxjc
2.4.0-b180725.0644