Wsimport failing in Java 11

Aditya Batra :

In Java 8, I was using codehaus' jaxws-maven-plugin version 2.5 for wsimport goal in maven. Now I am moving my application to Java 11 and the plugin execution gives error.

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

I found one workaround and used the following which resolved the error in 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>

I believe codehaus has not yet updated its plugin to provide support for Java11. Is my approach a right one, or is there any alternative?

Aditya Batra :

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>

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=69850&siteId=1