Reputation: 1
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.15.3</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>4.0.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>4.0.5</version>
</dependency>
</dependencies>
<configuration>
<schemaLanguage>WSDL</schemaLanguage>
<generateDirectory>${basedir}/target/generated-sources</generateDirectory>
<generatePackage>wsdl</generatePackage>
<schemaDirectory>${basedir}/src/main/resources/wsdl</schemaDirectory>
<schemaIncludes>
<include>*.wsdl</include>
</schemaIncludes>
<bindingDirectory>${basedir}/src/main/resources/binding</bindingDirectory>
<bindingIncludes>*.xml</bindingIncludes>
</configuration>
</plugin>
</plugins>
</build>
I am using the latest version of plugin and dependencies but not able to build.
[ERROR] Failed to execute goal org.jvnet.jaxb
your text
2.maven2:maven-jaxb2-plugin:0.15.3:generate (default) on project id3-global-integration: Execution default of goal org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.15.3:generate failed: A required class was missing while executing org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.15.3:generate: com/sun/xml/bind/api/ErrorListener
source is not generated in target folder.
Upvotes: -1
Views: 90
Reputation: 2848
You need to upgrade to jaxb-tools v4 in order to have JAXB4 compliant code generated by the plugin.
You can check the migration guide in order to understand the changes made from v0.x to the latest v4 version.
You should end up with
<plugin>
<groupId>org.jvnet.jaxb</groupId> <!-- new groupId of org.jvnet.jaxb2.maven2 -->
<artifactId>jaxb-maven-plugin</artifactId> <!-- new artifactId of maven-jaxb2-plugin -->
<version>4.0.8</version>
<!-- do not override jaxb-api nor jaxb-runtime -->
...
</plugin>
JAXB-Tools v4 supports Jakarta Xml Bind-Api v4.0 and needs JDK11 to run.
Upvotes: 0