6

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?

Naman
  • 27,789
  • 26
  • 218
  • 353
Aditya Batra
  • 263
  • 1
  • 2
  • 18
  • What error do you see? The tool `wsimport` is [no more available with JDK11](http://openjdk.java.net/jeps/320) – Naman Nov 28 '18 at 09:25
  • @nullpointer I am seeing following error : [ERROR] Failed to execute goal org.codehaus.mojo:jaxws-maven-plugin:2.5:wsimport (default) on project: Invocation of com.sun.tools.ws.wscompile.WsimportTool failed - check output – Aditya Batra Nov 29 '18 at 05:39
  • 1
    Already reported to `jaxws-maven-plugin` issues - https://github.com/mojohaus/jaxws-maven-plugin/issues/66 . You can give a workaround a try and provide the feedback https://github.com/phax/jaxws-maven-plugin#mojohaus-jax-ws-maven-plugin – Naman Nov 29 '18 at 05:49
  • 1
    Thank you. I have use the same workaround which seems to work fine right now. – Aditya Batra Nov 29 '18 at 06:39

2 Answers2

12

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>
Aditya Batra
  • 263
  • 1
  • 2
  • 18
0

I have recently migrated to OpenJdk 12 and I also got some problem generating java code from a WSDL. I solved the issue by using the reference implementation of JAX-WS. This is mentioned in the following source JEP 320: Remove the Java EE and CORBA Modules, (which has also been linked by @Naman in this thread).

I solved the issue by using the maven artifact com.sun.xml.ws:jaxws-ri

Mnemonics
  • 679
  • 1
  • 10
  • 26