Skip to content

JAXB Tools Migration Guide

Laurent Schoelens edited this page Jan 5, 2024 · 15 revisions

Migration Guide

This migration guide will help you migrate through major version of JAXB Tools

If you're coming from phax/maven-jaxb2-plugin :

  • you can follow the following migration section on how to get from com.helger.maven:jaxbXX-maven-plugin to our's.

Migration from previous version (0.x / 1.x) to v2

Starting from v2 of jaxb-tools, the following breaking changes occurs :

  • JDK8 Baseline : minimal support of jdk is JDK8; code is tested against JDK8 / JDK11 / JDK17
  • Drop of v2.0 / v2.1 / v2.2 plugins : older version of JAXB (prior to 2.3) are no longer supported
  • Artifact renaming / package changes : in order to provide a full set of tools, group and artifacts have been reorganized.
Artifact Older coordinates New coordinates
maven-plugin
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.15.x</version>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin</artifactId>
<version>2.0.9</version>
jaxb2-basics
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics</artifactId>
<version>0.13.x</version>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb2-basics</artifactId>
<version>2.0.9</version>
annox
<groupId>org.jvnet.annox</groupId>
<artifactId>annox</artifactId>
<version>1.0.2</version>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>annox</artifactId>
<version>2.0.9</version>
jaxb2-annotate
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics-annotate</artifactId>
<version>1.1.0</version>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-basics-annotate</artifactId>
<version>2.0.9</version>
hyperjaxb3
<groupId>org.jvnet.hyperjaxb3</groupId>
<artifactId>hyperjaxb3-ejb-plugin</artifactId>
<version>0.6.x</version>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>hyperjaxb3-ejb-plugin</artifactId>
<version>2.0.9</version>
  • New plugins in jaxb2-basics starting from v2.0.4 from previous repository (in order to make them jakarta-compatible in v3)
    • Commons Lang Plugin - generates the toString(), hashCode() and equals() methods using Apache commons-lang3. Will come in remplacement of previous org.jvnet.jaxb2_commons:jaxb2-commons-lang:2.4
    • Default Value Plugin - modifies the JAXB code model to set default values to the schema default attribute. Will come in remplacement of previous org.jvnet.jaxb2_commons:jaxb2-default-value:1.1
    • Fluent API Plugin - support a fluent api in addition to the default (JavaBean) setter methods. Will come in remplacement of previous org.jvnet.jaxb2_commons:jaxb2-fluent-api:3.0
    • Namespace Prefix Plugin - adds javax.xml.bind.annotation.XmlNs annotations to package-info.java files. Will come in remplacement of previous org.jvnet.jaxb2_commons:jaxb2-namespace-prefix:1.1
    • Value Constructor Plugin - generates another constructor, taking an argument for each field in the class and initialises the field with the argument value. Will come in remplacement of previous org.jvnet.jaxb2_commons:jaxb2-value-constructor:3.0

Migration from v2 to v3

Starting from v3 of jaxb-tools, the following breaking changes occurs :

  • JakartaEE9 support : this version supports v3 of JAXB-API and Runtime (major change is javax.* to jakarta.* package change)
  • Hyperjaxb3 : this version supports JPA3
  • Artifact renaming : in order to drop references to JAXB2, and avoid classes collision, some artifacts have been renamed.
Artifact Older coordinates New coordinates
jaxb2-basics
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb2-basics</artifactId>
<version>2.0.9</version>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-plugins</artifactId>
<version>3.0.0</version>
jaxb2-basics-runtime
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb2-basics-runtime</artifactId>
<version>2.0.9</version>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-plugins-runtime</artifactId>
<version>3.0.0</version>
jaxb2-basics-tools
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb2-basics-tools</artifactId>
<version>2.0.9</version>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-plugins-tools</artifactId>
<version>3.0.0</version>
jaxb2-annotate
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-basics-annotate</artifactId>
<version>2.0.9</version>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-plugin-annotate</artifactId>
<version>3.0.0</version>
  • Package changes : in order to drop references to JAXB2, and avoid classes collision, some packages have been renamed.
    • org.jvnet.jaxb2_commons (and subpackages) has been renamed to org.jvnet.jaxb
  • Namespaces change : in order to drop references to JAXB2, and to adopt more modern namespace, some namespaces have been renamed.
    • http://jaxb2-commons.dev.java.net/basic/ and subnamespaces were renamed to urn:jaxb.jvnet.org:plugin:. Previous namespaces will still work but will be dropped in future release. You can use the following changes to adapt your code.
      • http://jaxb2-commons.dev.java.net/basic/equals has been renamed to urn:jaxb.jvnet.org:plugin:equals
      • http://jaxb2-commons.dev.java.net/basic/inheritance has been renamed to urn:jaxb.jvnet.org:plugin:inheritance
    • http://annox.dev.java.net was renamed to urn:jaxb.jvnet.org:annox with partial backward support
    • http://hyperjaxb3.jvnet.org was renamed to urn:hyperjaxb3.jvnet.org with no backward support
    • http://hyperjaxb3.jvnet.org/ejb/schemas/customizations was renamed to urn:hyperjaxb3.jvnet.org:ejb:schemas:customizations with no backward support

Migration from v3 to v4

Starting from v4 of jaxb-tools, the following breaking changes occurs :

  • JakartaEE10 support : this version supports v4 of JAXB-API and Runtime
  • Hyperjaxb3 : this version supports JPA3.1 (JakartaEE10)
  • JDK11 baseline : since JakartaEE10 has JDK11 baseline, this version minimal support of jdk will be JDK11; code is tested against JDK11 / JDK17 / JDK21

Migration from phax/maven-jaxb2-plugin

If you're reading this, it's that you consider moving from phax/maven-jaxb2-plugin to highsource/jaxb-tools.

Here is the relation between phax's artifacts and ours :

Artifact Phax's coordinates Our's coordinates
V2.3 plugin
<groupId>com.helger.maven</groupId>
<artifactId>jaxb23-maven-plugin</artifactId>
<version>0.16.1</version>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin</artifactId>
<version>2.0.9</version>
V3.0 plugin
<groupId>com.helger.maven</groupId>
<artifactId>jaxb30-maven-plugin</artifactId>
<version>0.16.1</version>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin</artifactId>
<version>3.0.1</version>
V4.0 plugin
<groupId>com.helger.maven</groupId>
<artifactId>jaxb40-maven-plugin</artifactId>
<version>0.16.1</version>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin</artifactId>
<version>4.0.0</version>
V2.2 plugin
<groupId>com.helger.maven</groupId>
<artifactId>jaxb22-maven-plugin</artifactId>
<version>0.16.1</version>

No version available here.
Support of JAXB 2.2 has been dropped in v2 (see README).

Clone this wiki locally