bjornvester / wsdl2java-gradle-plugin

A Gradle plugin for generating Java classes from WSDL files
MIT License
41 stars 13 forks source link

Spring boot v3 and later issues #23

Closed hedeonH closed 1 year ago

hedeonH commented 1 year ago

When I try to update my spring boot version from 2.7.11 to 3.0.0, I start to get weird exception during executing wsdl2java task .

Execution failed for task ':wsdl2java'.

A failure occurred while executing com.github.bjornvester.wsdl2java.Wsdl2JavaWorker javax/xml/bind/JAXBException

Unable to load class 'javax.xml.bind.JAXBException'.

bjornvester commented 1 year ago

Spring Boot 3 requires using the jakarta namespace, and there can be a lot of changes needed to switch from the javax namespace. This exception is likely because the plugin generated code using javax, but dependencies were updated to jakarta so the class no longer exists.

I recently published a new version 2.0 of the plugin that defaults to the jakarta dependencies needed for Spring Boot 3.

strelchm commented 1 year ago

After switching to new version I have the next error: A problem was found with the configuration of task ':wsdl2java' (type 'Wsdl2JavaTask'). - In plugin 'com.github.bjornvester.wsdl2java' type 'com.github.bjornvester.wsdl2java.Wsdl2JavaTask' property 'javaLauncher' doesn't have a configured value.

bjornvester commented 1 year ago

Thanks for reporting - I will take a look at the launcher problem tonight.

In the meantime, I think you can get around it by setting the following in the project using wsdl2java:

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(17) // Or whatever you are using
    }
}
strelchm commented 1 year ago

thanks much, with cxfVersion.set("4.0.2") it's work!