highsource / jaxb2-basics

Useful plugins and tools for JAXB2.
BSD 2-Clause "Simplified" License
108 stars 54 forks source link

Jakarta classes support for jaxb2-basics #162

Closed yurii20041 closed 7 months ago

yurii20041 commented 1 year ago

Hi, jaxb2-basics isn't compatible with Jakarta EE 9 classes provided by Spring 6. E.g. JAXBEqualsStrategy uses javax.xml.bind.JAXBElement inside the logic that isn't compatible with the latest Spring version.

I'm wondering, if you have any plan to fix it? Thanks!

patrodyne commented 1 year ago

My fork at hisrc-basicjaxb replaces the javax.xml.bind imports with their newer jakarta.xml.bind equivalents. My fork's releases, starting with v2.0.0 in the Maven Central Repository, support the Jakarta EE XML Binding, Specification v3.0.

Note: If you are interested then be sure to review that project's readme for changes to package names and namespaces. If you have questions about my fork, please post any questions over there.

yurii20041 commented 1 year ago

Hi @patrodyne, Unfortunately, I can't find the mentioned 2.0.0 version for hisrc-basicjaxb in the maven central repo: https://repo1.maven.org/maven2/org/patrodyne/jvnet/hisrc-basicjaxb/

I'm looking forward to your clarification. Thanks!

patrodyne commented 1 year ago

No problem, see Clarification of hisrc-basicjaxb-plugins.

laurentschoelens commented 1 year ago

Hi @yurii20041 PR provided for this : https://github.com/highsource/jaxb2-basics/pull/165 Feel free to comment

proclos commented 1 year ago

I just used this fork of your project with JAXB version 4.0.2 (Jakarta): https://github.com/qantasloyalty/lsl-jaxb3-basics

Though it claims only version 3 support, it seems to work also for version 4 already. I tried it out in the scope of quarkus3, Alpha5.

Maybe you can/want to reintegrate this fork?

laurentschoelens commented 1 year ago

@proclos : thanks for your comment. I think that people should have done PR with their forks (I've seen many forks from the original @highsource work from both jaxb-basics and jaxb-plugin).

Since jaxb 3 and jaxb 4 are not so different (jaxb 4 has jdk11 baseline), the artefact should just work for both.

@mattrpav will soon migrate both jaxb2-basics and plugin to jakarta jaxb support I think

linuxmin commented 1 year ago

Any updates on this? @laurentschoelens @mattrpav

laurentschoelens commented 1 year ago

Hi @linuxmin : sorry but I just provided the PR, I'm not official contributor in highsource projects. @mattrpav : If I can help on this, or do some rework, just tell me, I'd be glad to help more on this migrations.

mattrpav commented 1 year ago

Hey @laurentschoelens @linuxmin - hoping to get to this shortly. We need it with ActiveMQ as well. I have been tied up getting jakarta work going over there as well. Thanks for the patience. For sure, we'll get this going.

Questions:

  1. I think we should cleanup the package names (remove version # and _). Does anyone see any issues with package names changing? My thinking is that these classes get added in via generation and aren't used directly. Also, the previous classes had jaxb2 in the name so that would justify supporting a change imo. Thoughts?

  2. Along those lines, going to see about tidying up the maven gav to org.jvnet.jaxb (no vers number in the groupId). If we need multi-version we can handle that in the artifactId. Any issues?

Thanks! Matt

linuxmin commented 1 year ago

@mattrpav Thanks for the quick answer, that's good news! Very much appreciate your work for ActiveMQ too, as we need the Jakarta Client as well for migration to the Jakarta namespace. Keep up the good work!

laurentschoelens commented 1 year ago

Hey @laurentschoelens @linuxmin - hoping to get to this shortly. We need it with ActiveMQ as well. I have been tied up getting jakarta work going over there as well. Thanks for the patience. For sure, we'll get this going.

Questions:

  1. I think we should cleanup the package names (remove version # and _). Does anyone see any issues with package names changing? My thinking is that these classes get added in via generation and aren't used directly. Also, the previous classes had jaxb2 in the name so that would justify supporting a change imo. Thoughts?

That what I made by changing package name to jaxb3_basics. If you want me to do the refacto to jaxbbasics package name, tell me, I can rework on this

  1. Along those lines, going to see about tidying up the maven gav to org.jvnet.jaxb (no vers number in the groupId). If we need multi-version we can handle that in the artifactId. Any issues?

No issues on this too.

Thanks! Matt

timomeinen commented 1 year ago

Any news on the planned migration plan?

In the meanwhile I am using hisrc-basicjaxb-plugins from @patrodyne and it works nicely.

laurentschoelens commented 1 year ago

Hi @timomeinen : work is still in progress Hope to get well soon.

marinkobabic commented 1 year ago

Hi @laurentschoelens @mattrpav what is the actual state here? Should we wait for the new version or look for an alternate solution?

laurentschoelens commented 1 year ago

Hi @marinkobabic We merged jaxb2-basics in main repo jaxb-tools (which is former maven-jaxb2-plugin). We're working on bugfixes on v2.3 version of jaxb and then move on to provide the first version of v3 jaxb jakarta version

If you need jakarta support before official release, see this comment which propose a quickwin by replacing javax package import by jakarta ones after generation : https://github.com/highsource/jaxb-tools/issues/233#issuecomment-1632508716

Tested OK and jaxb-basics-runtime doesn't have jaxb 2.3 dependencies in my opinion so it's OK.

marinkobabic commented 1 year ago

@laurentschoelens thanks for the feedback. Is my understanding correct: Your suggestion is to go with the version 0.13.1 and to replace javax package imports until you have the official version?

Any idea when roughly the official version v2.3 will be available?

laurentschoelens commented 1 year ago

@laurentschoelens thanks for the feedback. Is my understanding correct: Your suggestion is to go with the version 0.13.1 and to replace javax package imports until you have the official version?

Any idea when roughly the official version v2.3 will be available?

I don't clearly understand your answer. My suggestion is to use jaxb-maven-plugin with actual jaxb-basics release and add the ant part as suggested my previous comment to make generated code goes from javax to jakarta If you're not using maven-jaxb2-plugin, I don't know if actual version of jaxb-basics can do the job. Could you share more context on this one ? What kind of plugin are you using and what kind of error do you encounter ?

laurentschoelens commented 11 months ago

@linuxmin / @yurii20041 / @proclos / @marinkobabic and @timomeinen : we did release v2 / v3 / v4 versions of jaxb-tools recently with jakarta support

laurentschoelens commented 7 months ago

Fixed in https://github.com/highsource/jaxb-tools/releases/tag/3.0.0 and https://github.com/highsource/jaxb-tools/releases/tag/4.0.0

david0 commented 6 months ago

Great that a way has been found to continue Alexeys legacy!!!