Does plugin "io.mateo.cxf-codegen" version "1.2.0" support Spring boot 3 ? because when i am trying to generate java classes from wsdl - I always get error like Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
I have used apache cxf version 4.0.0 and already tried to include below dependency in my gradle file.
implementation 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.0' implementation 'org.glassfish.jaxb:jaxb-runtime:4.0.0'
Since I am using Spring boot 3 so i am already using java-17
The plugin io.mateo.cxf-codegen
has nothing to do with Spring Boot. The plugin's job is to provide you a way to generate Java sources from a given WSDL. The code generation is accomplished by delegating to the underlying tool from Apache CXF wsdl2java
.
Version 1.2.x of the plugin is based on Apache CXF 3.5.x which in turn is based on Java EE 8.x (javax.*
namespace). This can be changed however to generate code For Jakarta by configuring the CXF version used by the plugin as described in the documentation: https://ciscoo.github.io/cxf-codegen-gradle/docs/1.2.1/user-guide/#jakarta
However, since you are using Spring Boot 3, it is better to use the current version of the plugin which is v2.2.0. The current version is based on Apache CXF 4.0.x as described in the documentation: https://ciscoo.github.io/cxf-codegen-gradle/docs/current/user-guide/#dependency-configuration
Additionally, you need to make sure you are using the correct dependencies throughout your entire project. You should not be mixing old Java EE dependencies with Jakarta ones.
Note I am the author of the plugin.