“ org.jvnet.jaxb2.maven2” Maven插件在Eclipse中显示错误

时间:2018-08-13 06:21:45

标签: java web-services maven-3

我想使用“ org.jvnet.jaxb2.maven2” maven插件从Web服务生成类。但是在日食中显示如下错误:

Execution default of goal org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.12.3:generate failed: 
A required class was missing while executing org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.12.3:generate: com/sun/xml/bind/api/ErrorListener

下面是pom片段:

<plugin>
    <groupId>org.jvnet.jaxb2.maven2</groupId>
    <artifactId>maven-jaxb2-plugin</artifactId>
    <version>0.12.3</version>
    <executions>
        <execution>
            <goals>
                <goal>generate</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <schemaLanguage>WSDL</schemaLanguage>
        <generatePackage>fpcy.wsdl</generatePackage>
        <schemas>
            <schema>
                <url>{the web sevice url}</url>
            </schema>
        </schemas>
    </configuration>
</plugin>

和jre配置: enter image description here

但是如何将此类添加到我的项目中?

1 个答案:

答案 0 :(得分:0)

我找到了自己解决问题的方法: 将jaxb插件工件ID从“ maven-jaxb2-plugin”更改为“ maven-jaxb20-plugin”。请参阅Using-a-Specific-JAXB-Version