JDK9 support
eximius313 opened this issue · comments
I was trying to run wsdl2java
in JDK9 and I got following error:
:backend:wsdl2java Errors occurred while build effective model from C:\Users\.gradle\caches\modules-2\files-2.1\com.sun.xml.bind\jaxb-xjc\2.2.11\4da3d39ae8ccc39549e3f8971f56035f61d7bf79\jaxb-xjc-2.2.11.pom:
'dependencyManagement.dependencies.dependency.systemPath' for com.sun:tools:jar must specify an absolute path but is ${tools.jar} in com.sun.xml.bind:jaxb-xjc:2.2.11
Errors occurred while build effective model from C:\Users\.gradle\caches\modules-2\files-2.1\com.sun.xml.bind\jaxb-core\2.2.11\db0f76866c6b1e50084e03ee8cf9ce6b19becdb3\jaxb-core-2.2.11.pom:
'dependencyManagement.dependencies.dependency.systemPath' for com.sun:tools:jar must specify an absolute path but is ${tools.jar} in com.sun.xml.bind:jaxb-core:2.2.11
Errors occurred while build effective model from C:\Users\.gradle\caches\modules-2\files-2.1\com.sun.xml.bind\jaxb-impl\2.2.11\2d4b554997fd01d1a2233b1529b22fc9ecc0cf5c\jaxb-impl-2.2.11.pom:
'dependencyManagement.dependencies.dependency.systemPath' for com.sun:tools:jar must specify an absolute path but is ${tools.jar} in com.sun.xml.bind:jaxb-impl:2.2.11
Does it work with the same project on jdk8?
Yes
Does not work with JDK10 as well
Ok. A pull-request to fix this is highly appreciated. I am not using this plugin actively any more, so all help is appreciated.
I'm getting the following,executed with Java 10:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':wsdl2java'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:103) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException at org.apache.cxf.tools.wsdlto.WSDLToJava.<init>(WSDLToJava.java:48) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Add com.sun.xml.bind:jaxb-xjc:2.3.0.1 to the dependencies:
wsdl2java 'com.sun.xml.bind:jaxb-xjc:2.3.0.1'
compileOnly 'com.sun.xml.bind:jaxb-xjc:2.3.0.1'
xjc 2.3 now jdk 9-10 (module) compatible
I added the dependency to my project.
This is what I needed to add to my build.gradle
script dependencies
section in order for the task to run successfully:
implementation 'com.sun.xml.bind:jaxb-xjc:2.3.0.1'
implementation 'javax.xml.bind:jaxb-api:2.3.1'
implementation 'javax.xml.ws:jaxws-api:2.3.1'
implementation 'org.apache.cxf:cxf-rt-wsdl:3.2.7'
implementation 'javax.jws:javax.jws-api:1.1'
@alediaferia, could you write a section of how to do this for Java 9 in the readme and submit a pullrequest?