highsource/jaxb-tools

JAXB plugin v3.x roadmap

mattrpav opened this issue ยท 36 comments

Current plans for v3.x roadmap:

Features

  1. Release a jakarta compatible v3.x release
  2. Migrate to new groupId/artifactId org.jvnet.jaxb/jaxb-maven-plugin (more recent maven standard)
  3. Align plugin version with jaxb release version as much as possible
  4. Migrate jaxb plugin-plugin projects (and maybe jaxb2-basics) to be child modules of this tree
  5. Add toolchain awareness

Deprecation

  1. JDK 1.6 and 1.7 support
  2. Dropping plugin-2.0, 2.1 and 2.2 support.

The goal of this is to make it more straight forward to consume the modules (esp plugin-plugins) and know if versions are compatible in light of the major JEE/Jakarta changes. Support for multiple versions aligning to various jaxb versions (too complicated and confusing to users in light of jakarta change)

Please use this ticket for comments, discussion and questions.

Thanks!

Any progress on this?

The new jakarta packages (JAXB 3 and 4) work with the evolvedbinary fork:

<plugin>
    <groupId>com.evolvedbinary.maven.jvnet</groupId>
    <artifactId>jaxb30-maven-plugin</artifactId>
    <version>0.15.0</version>
</plugin>

There's no point continuing to support the old javax stuff any more. There's already plenty of historic releases that support that. There simply needs to be a maven-jaxb-plugin that works with the newer packages with JDK 11 and above. (note that Jakarta XML Binding 4 requires Java 11 or higher)

Hello,

Are there any plans to adopt jaxb30-maven-plugin fork for the main project? I checked the fork, it seems to be working, but I do not want to include it to the project without maintenance.

Maybe have it as a separate branch with Jakarta support? Preferably the support of JDK 8 should not be dropped, as Jakarta 3 supports Java 8.

Best regards,
Aleksandr.

Yes, jakarta support is coming

The new jakarta packages (JAXB 3 and 4) work with the evolvedbinary fork:

Can you provide the dependencies you used in both the pom dependencies section and in the jaxb30-maven-plugin section to make it work?

When I provide jaxb 3.x dependencies, the build complains of missing class like javax/xml/bind/JAXBException

Can you provide the dependencies you used in both the pom dependencies section and in the jaxb30-maven-plugin section to make it work?

https://github.com/SingingBush/jaxb-example/blob/main/pom.xml

Just wondering if this is something which is going to be merged to main or you guys are working on the jakarta support in another place @mattrpav?

UPDATE: forgot to add the link to the PR which i was wondering about #255

Also wondering if there are any thoughts on this project here https://github.com/patrodyne/hisrc-higherjaxb or any plans to integrate changes back to the original project?

@mattrpav any news on this ?

Hello,

SpringBoot stops OSS support of version 2.7.x at the end of the year. The newer version SpringBoot 3.x comes with Jakarta 4, thus requiring all applications to upgrade to Jakarta namespaces, and the upgrade becomes vital for a lot of users.

Could you please provide with a rough estimate on the planning of when the Jakarta support becomes available?

Thank you!

Best regards,
Aleksandr.

Hi @bsanchezb

There's a PR #255 for this upgrade but we are waiting for @mattrpav to check and merge it (and then release it).
We've tested the updated plugin on many projects (manual build) and it's OK.

The https://github.com/highsource/jaxb2-basics plugin also have same PR for jakarta migration namespace

Regards

I know that probably that's not an appropriate place to share it, but I came up with the simplest workaround that got me through the javax -> jakarta problem during working on my project:

Simply add ant replace after the jaxb plugin:

<build>
        <plugins>
            <plugin>
                <groupId>org.jvnet.jaxb</groupId>
                <artifactId>jaxb-maven-plugin</artifactId>
                <!-- your configuration of the plugin -->
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <configuration>
                            <target>
                                <replace dir="target/generated-sources" value="jakarta.xml.bind">
                                    <include name="**/*.java"/>
                                    <replacetoken>javax.xml.bind</replacetoken>
                                </replace>
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
...

It is hacky but I need to get job done :-)

@mikhail-putilov thanks for sharing this tip.
The big part before migrating to jakarta is currently under review by @mattrpav
After that we'll be able to provide a version compatible with jakarta

titro commented

Any concrete schedule around that? There is no Spring Boot 2.X support by the end of the year so time is running out....

Any concrete schedule around that? There is no Spring Boot 2.X support by the end of the year so time is running out....

Hi @titro

I'll not give you hope of a concrete date since we're still working on bugfixes on the v2 version (which support jaxb 2.3).

But what I can say is that we're doing active work on this and hope to cut 2.0.4 release this week. Then work on jakarta version based on initial PR I provided so we should be able to cut 3.0.0 release very soon.
In the meantime, you should be able to use this workaround #233 (comment)

Feel free to come back if you have any problems with it.

Jakarta is coming, the major refactoring is going to land this week and jaxb3 support should come shortly after.
Stay tuned

soc commented

Excellent, thank you for the update!

I'll be happy to migrate w3c-schemas and ogc-schemas to Jakarta as soon as your work lands.

Excellent, thank you for the update!

I'll be happy to migrate w3c-schemas and ogc-schemas to Jakarta as soon as your work lands.

Annox and jaxb-annotate-plugin are now part of jaxb-tools
Hyperjaxb is on it's way too

soc commented

Have you decided whether/if it's possible to keep the existing groupId/domain?

Have you decided whether/if it's possible to keep the existing groupId/domain?

Didnt understand your point...
All artifacts are now published under org.jvnet.jaxb

@soc could you reword / precise your question please ? ๐Ÿ˜ƒ

soc commented

I think you answered my question, thanks. :-)

I think you answered my question, thanks. :-)

And is it good news ? ๐Ÿ˜€

soc commented

It means that from my understanding you managed to get control over the domain, and therefore are able to publish artifacts under the existing coordinates?

It means that from my understanding you managed to get control over the domain, and therefore are able to publish artifacts under the existing coordinates?

Yes @mattrpav take over maintenance and managed to publish under the main groupId org.jvnet.jaxb (will also publish relocation poms to help migration) and I'm new collaborator to the project from few weeks now thanks to him

soc commented

FYI: I have published w3c-schemas and ogc-schemas using the hack mentioned in #233 (comment), but will do a proper patch release after JAXB supports 3.x.

soc commented

One thing I realized is that w3c-schemas, ogc-schemas and ogc-tools-gml-jts still have a hidden dependency on javax.xml.bind caused by generated code using org.jvnet.jaxb2_commons.locator.ObjectLocator which extends javax.xml.bind.ValidationEventLocator.

So hopefully there is also a new release of jaxb2_commons to address this.

One thing I realized is that w3c-schemas, ogc-schemas and ogc-tools-gml-jts still have a hidden dependency on javax.xml.bind caused by generated code using org.jvnet.jaxb2_commons.locator.ObjectLocator which extends javax.xml.bind.ValidationEventLocator.

So hopefully there is also a new release of jaxb2_commons to address this.

@soc we hope to get a new release soon (2.0.6) and then move to jakarta version

Any news on jaxb 3 Jakarta support for the JAXB Maven Plugin?

Planning to release shortly! Hopefully, within the next 5-10 days.

Watch the v3 milestone to keep tabs on it

@mattrpav thank you for the very fast response and for your work!

Lonzak commented

Planning to release shortly! Hopefully, within the next 5-10 days.

Thank you. I think we all can't wait to get v3.

Count-Down: 7 days to go.

We are doing one last major change on v3 with new namespace for plugins, with support of older and warning to move to newer.
Older namespace support will be dropped after v4-based plugin.
Once done, and tested, we'll be ready to GO ๐Ÿš€

Hello everyone
Version 3.0.0 released (followed by 3.0.1 bugfix)
Working on 4.0 now
Enjoy

Lonzak commented

I tried the new plugin and it works nicely and the classes are generated. The only thing I didn't get working was the "toString" Plugin so I had to throw this out...

@Lonzak : could you share more context on this error of the toString plugin ?
If needed, you can create a question issue so we can help you with this ๐Ÿ˜„