I'm upgrading a Spring Boot 2.7.0 project from Java 8 to Java 11. The project is using maven-jaxb2-plugin to generate classes from wsdl files.
This is the configuration
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.15.1</version>
<executions>
<execution>
<id>organisationalStructure</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<schemaLanguage>WSDL</schemaLanguage>
<generateDirectory>${project.build.directory}/generated-sources</generateDirectory>
<generatePackage>com.test.organisationalStructure</generatePackage>
<schemas>
<schema>
<fileset>
<directory>${basedir}/src/main/resources/wsdl/</directory>
<include>organisationStructure.wsdl</include>
</fileset>
</schema>
</schemas>
<readOnly>true</readOnly>
<removeOldOutput>false</removeOldOutput>
<forceRegenerate>true</forceRegenerate>
</configuration>
</execution>
The configuration stays the same in both versions, only the version of maven-jaxb2-plugin changes from 0.13.3 to 0.15.1. I had to add new maven dependencies jaxwx-api and saaj-impl. They use the default version which comes from Spring Boot.
The output, when running mvn clean install with Java 8, is
[INFO] --- maven-jaxb2-plugin:0.13.3:generate (organisationalStructure) @ redb2b --- [WARNING] You are using forceRegenerate=true in your configuration. This configuration setting is deprecated and not recommended as it causes problems with incremental builds in IDEs. Please refer to the following link for more information: https://github.com/highsource/maven-jaxb2-plugin/wiki/Do-Not-Use-forceRegenerate Consider removing this setting from your plugin configuration. [INFO] The [forceRegenerate] switch is turned on, XJC will be executed. [INFO] Episode file [C:\RPSS\B2B-portal\target\generated-sources\META-INF\sun-jaxb.episode] was augmented with if-exists="true" attributes.
When running mvn clean install with Java 11, the output is identical but it also contains an exception
org.xml.sax.SAXParseException: Are you trying to compile WSDL? Support for WSDL is experimental. You may enable it by using the -wsdl option.
The SAXParseException comes between the last 2 [INFO] lines. The code is generated successfully from the wsdl file and the application behaves fine.
Still, I would like to understand the reason behind the exception. Nothing changes in the wsdl.
Thanks.