首页 > 解决方案 > Wsimport 在 Java 11 中失败

问题描述

在 Java 8 中,我将 codehaus 的 jaxws-maven-plugin 2.5 版用于 maven 中的 wsimport 目标。现在我将我的应用程序移动到 Java 11 并且插件执行给出了错误。

<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<versionRange>2.5</versionRange>

我找到了一种解决方法并使用以下解决了 Java 11 中的错误 - :

<plugin>
    <groupId>com.helger.maven</groupId>
    <artifactId>jaxws-maven-plugin</artifactId>
    <version>2.6</version>
        <executions>
            <execution>
                <goals>
                    <goal>wsimport</goal>
                </goals>
                <configuration>
                    <vmArgs>
                        <vmArg>-Djavax.xml.accessExternalSchema=all</vmArg>
                    </vmArgs>

我相信 codehaus 还没有更新它的插件来提供对 Java11 的支持。我的方法是正确的,还是有其他选择?

标签: javamavenwsimportjava-11jaxws-maven-plugin

解决方案


I solved the issue by using the following plugin

<groupId>com.helger.maven</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
    <version>2.6</version>

Update : New plugin is available which can be used for this purpose. Apparently com.helger plugin was just a temporary workaround.

<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
    <version>2.3.2</version>

推荐阅读