【问题标题】:build fail with cxf-codegen-plugin使用 cxf-codegen-plugin 构建失败
【发布时间】:2018-08-01 23:19:29
【问题描述】:
我将一个带有模块的现有项目导入到 Eclipse 中,这是由第三方创建的现有代码,我需要尝试理解。但是一个项目在 mvn clean install 上一直失败,并且不断出现以下错误;这似乎与网络服务问题有关:
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]
这是使用网络服务验证凭据的用户安全项目。
【问题讨论】:
标签:
eclipse
maven
dependencies
【解决方案1】:
如果您为 Maven 和“打印异常堆栈跟踪”激活“调试”模式,并且错误是 BadCommandLineException 的 NoClassDefFoundError,那么我通过提供对 cxf-codegen-plugin 的依赖项来解决它:
<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>