0

It's not clear to me if I'm able to use maven-jaxb2-plugin on a jdk11 maven project.

My pom.xml and mvn are using jdk11.

I know jaxb is not distributed with jdk 11.

I'm trying to generate code from wsdl:

           <plugin>
                <groupId>org.jvnet.jaxb2.maven2</groupId>
                <artifactId>maven-jaxb2-plugin</artifactId>
                <version>0.14.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>

                <configuration>
                    <schemaLanguage>WSDL</schemaLanguage>
                    <generateDirectory>${project.basedir}/src/main/java/generated-sources/kenexa</generateDirectory>
                    <generatePackage>com.baeldung.springsoap.client.gen</generatePackage>
                    <schemaDirectory>${project.basedir}/src/main/resources</schemaDirectory>
                    <noFileHeader>true</noFileHeader>
                    <schemaIncludes>
                        <include>*.wsdl</include>
                    </schemaIncludes>
                </configuration>
            </plugin>

I'm getting:

$ mvn generate-sources   
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------< cat.catsalut.hes.visor:hes-visor-api-service >------------
[INFO] Building Visor HES 0.0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-jaxb2-plugin:0.14.0:generate (default) @ hes-visor-api-service ---
[INFO] Latest timestamp of the source resources is [2021-01-13 16:40:21.396], earliest timestamp of the target resources is [2021-01-13 16:40:28.828].
[INFO] Sources are up-to-date, XJC will be skipped.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  9.616 s
[INFO] Finished at: 2021-01-13T16:40:40+01:00
[INFO] ------------------------------------------------------------------------
```

Any ideas?
Jordi
  • 20,868
  • 39
  • 149
  • 333

1 Answers1

0

We too faced a similar issue with maven wrapper + maven-jaxb2-plugin (0.14.0) + jdk 11 combinations. Somehow the generated classes were based on the old XSD file though the latest ones were in the schemaDirectory location. ¯_(ツ)_/¯

Upgrading the maven-jaxb2-plugin to 0.15.3 seems to fix it for us.

Syam
  • 1
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 31 '23 at 06:08