gpt4 book ai didi

java - cxf-xjc 插件 "Must specify xsdOptions"错误

转载 作者:行者123 更新时间:2023-12-04 16:06:44 25 4
gpt4 key购买 nike

我正在使用 cxf-xjc 插件来生成 Java 类。这是成功生成Java类的xjc命令。

xjc -d C:\Users\abc\devEnv\VcloudJavaClasses -catalog C:\Users\abc\devEnv\schema-files\schemas\external\catalog.xml -b C:\Users\abc\devEnv\schema-files\1.5\schemas\vcloud\vcloud.xjb -b C:\Users\abc\devEnv\schema-files\1.5\schemas\vcloud\ovf.xjb -b C:\Users\abc\devEnv\schema-files\1.5\schemas\extension\vmwextensions.xjb C:\Users\abc\devEnv\schema-files\1.5\schemas\master\master.xsd C:\Users\abc\devEnv\schema-files\1.5\schemas\extension\vmwextensions.xsd -nv

我正在尝试将此 xjc 命令映射到 cxf-xjc 插件。

但我收到以下错误。

[ERROR] Failed to execute goal org.apache.cxf:cxf-xjc-plugin:2.3.0:xsdtojava (default-cli) on project vcloud-training: Must specify xsdOptions -> [Help 1]

这是关于插件的pom部分。

    <plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-xjc-plugin</artifactId>
<version>2.3.0</version>
<configuration>
<extensions>
<extension>org.apache.cxf.xjcplugins:cxf-xjc-dv:2.3.0</extension>
</extensions>
</configuration>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>xsdtojava</goal>
</goals>
<configuration>
<sourceRoot>C:\Users\abc\devEnv\schema-files-pom</sourceRoot>
<xsdOptions>
<xsdOption>
<xsd>C:\Users\abc\devEnv\schema-files\1.5\schemas\master\master.xsd</xsd>
<xsd>C:\Users\abc\devEnv\schema-files\1.5\schemas\extension\vmwextensions.xsd</xsd>
<bindingFile>classpath:/schemas/wsdl/http.xjb</bindingFile>
<bindingFile>C:\Users\abc\devEnv\schema-files\1.5\schemas\vcloud\vcloud.xjb</bindingFile>
<bindingFile>C:\Users\abc\devEnv\schema-files\1.5\schemas\vcloud\ovf.xjb</bindingFile>
<bindingFile>C:\Users\abc\devEnv\schema-files\1.5\schemas\extension\vmwextensions.xjb</bindingFile>
<catalog>C:\Users\abc\devEnv\schema-files\schemas\external\catalog.xml</catalog>
</xsdOption>
</xsdOptions>
</configuration>
</execution>
</executions>
</plugin>

配置有什么问题所以我得到这个错误?

最佳答案

尝试像这样将配置置于执行之外:

<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-xjc-plugin</artifactId>
<version>2.3.0</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>xsdtojava</goal>
</goals>
</execution>
</executions>
<configuration>
<sourceRoot>C:\Users\abc\devEnv\schema-files-pom</sourceRoot>
<xsdOptions>
<xsdOption>
<xsd>C:\Users\abc\devEnv\schema-files\1.5\schemas\master\master.xsd</xsd>
<xsd>C:\Users\abc\devEnv\schema-files\1.5\schemas\extension\vmwextensions.xsd</xsd>
<bindingFile>classpath:/schemas/wsdl/http.xjb</bindingFile>
<bindingFile>C:\Users\abc\devEnv\schema-files\1.5\schemas\vcloud\vcloud.xjb</bindingFile>
<bindingFile>C:\Users\abc\devEnv\schema-files\1.5\schemas\vcloud\ovf.xjb</bindingFile>
<bindingFile>C:\Users\abc\devEnv\schema-files\1.5\schemas\extension\vmwextensions.xjb</bindingFile>
<catalog>C:\Users\abc\devEnv\schema-files\schemas\external\catalog.xml</catalog>
</xsdOption>
</xsdOptions>
<extensions>
<extension>org.apache.cxf.xjcplugins:cxf-xjc-dv:2.3.0</extension>
</extensions>
</configuration>
</plugin>

关于java - cxf-xjc 插件 "Must specify xsdOptions"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47527106/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com