rewrite icon indicating copy to clipboard operation
rewrite copied to clipboard

Add migration of maven-jaxb2-plugin in JakartaEE9 recipe

Open apupier opened this issue 2 years ago • 2 comments

org.jvnet.jaxb2.maven2:maven-jaxb2-plugin is a plugin used to generate Java code. It is notably generating a bunch of javax.xml.* code.

To generate code with jakarta namespace, we currently need to migrate to another plugin com.helger.maven:jaxb40-maven-plugin because the original one seems to no more be active enough, the PR to migrate is still pending.

In case org.jvnet.jaxb2_commons:jaxb2-namespace-prefix is used in combination of it, this one needs to be updated to version 2.0

I think it can be a nice addition to JakartaEE9 recipe.

Example of a typical use case:

<plugin>
                    <groupId>org.jvnet.jaxb2.maven2</groupId>
                    <artifactId>maven-jaxb2-plugin</artifactId>
                    <version>0.15.2</version>
                     <dependencies>
                         <dependency>
                             <groupId>org.jvnet.jaxb2_commons</groupId>
                             <artifactId>jaxb2-namespace-prefix</artifactId>
                            <version>1.3</version>
                         </dependency>
                     </dependencies>
</plugin>
<plugin>
                    <groupId>com.helger.maven</groupId>
                    <artifactId>jaxb40-maven-plugin</artifactId>
                    <version>0.16.1</version>
                     <dependencies>
                         <dependency>
                             <groupId>org.jvnet.jaxb2_commons</groupId>
                             <artifactId>jaxb2-namespace-prefix</artifactId>
                            <version>2.0</version>
                         </dependency>
                     </dependencies>
</plugin>

apupier avatar May 07 '23 15:05 apupier

In case *.ejb files are used for the generation, to avoid an exception in log during code generation with this Maven plugin, the following changes are also needed in *.ejb files:

  • namespace from http://java.sun.com/xml/ns/jaxb to https://jakarta.ee/xml/ns/jaxb
  • version from 1.0 or 2.0 to 3.0

apupier avatar May 26 '23 12:05 apupier

official versions and a migration guide: https://github.com/highsource/jaxb-tools/wiki/JAXB-Tools-Migration-Guide

nitschSB avatar Dec 13 '23 10:12 nitschSB