Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JAXB plugin v3.x roadmap #233

Closed
mattrpav opened this issue Apr 25, 2022 · 36 comments
Closed

JAXB plugin v3.x roadmap #233

mattrpav opened this issue Apr 25, 2022 · 36 comments
Assignees
Labels
documentation Adding or updating documentation jakarta jaxb3 Issue with jaxb 3.x
Milestone

Comments

@mattrpav
Copy link
Collaborator

mattrpav commented Apr 25, 2022

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!

@mattrpav mattrpav added this to the 3.x milestone Apr 25, 2022
@mattrpav mattrpav self-assigned this Apr 25, 2022
@DanielGronau
Copy link

Any progress on this?

@SingingBush
Copy link

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)

@bsanchezb
Copy link

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.

@mattrpav
Copy link
Collaborator Author

Yes, jakarta support is coming

@johnsgithubaccount
Copy link

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

@SingingBush
Copy link

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

@vassik
Copy link

vassik commented Feb 22, 2023

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?

@laurentschoelens
Copy link
Collaborator

@mattrpav any news on this ?

@bsanchezb
Copy link

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.

@laurentschoelens
Copy link
Collaborator

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

@mattrpav mattrpav modified the milestones: 3.x, 3.0.0 May 9, 2023
@mikhail-putilov
Copy link

mikhail-putilov commented Jul 12, 2023

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 :-)

@laurentschoelens
Copy link
Collaborator

@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
Copy link

titro commented Aug 9, 2023

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

@laurentschoelens
Copy link
Collaborator

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.

@laurentschoelens
Copy link
Collaborator

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

@laurentschoelens laurentschoelens added jaxb3 Issue with jaxb 3.x jakarta labels Aug 20, 2023
@soc
Copy link
Contributor

soc commented Aug 27, 2023

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.

@laurentschoelens
Copy link
Collaborator

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
Copy link
Contributor

soc commented Aug 27, 2023

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

@laurentschoelens
Copy link
Collaborator

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

@laurentschoelens
Copy link
Collaborator

@soc could you reword / precise your question please ? 😃

@soc
Copy link
Contributor

soc commented Aug 27, 2023

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

@laurentschoelens
Copy link
Collaborator

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

And is it good news ? 😀

@soc
Copy link
Contributor

soc commented Aug 27, 2023

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?

@laurentschoelens
Copy link
Collaborator

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
Copy link
Contributor

soc commented Aug 30, 2023

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
Copy link
Contributor

soc commented Sep 1, 2023

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.

@laurentschoelens
Copy link
Collaborator

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

@mattrpav mattrpav added the documentation Adding or updating documentation label Sep 14, 2023
@mattrpav
Copy link
Collaborator Author

#389

@m2nhawk
Copy link

m2nhawk commented Sep 26, 2023

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

@mattrpav
Copy link
Collaborator Author

mattrpav commented Sep 26, 2023

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

Watch the v3 milestone to keep tabs on it

@m2nhawk
Copy link

m2nhawk commented Sep 26, 2023

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

@Lonzak
Copy link

Lonzak commented Sep 29, 2023

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.

@laurentschoelens
Copy link
Collaborator

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 🚀

@laurentschoelens
Copy link
Collaborator

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

@Lonzak
Copy link

Lonzak commented Oct 12, 2023

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...

@laurentschoelens
Copy link
Collaborator

@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 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Adding or updating documentation jakarta jaxb3 Issue with jaxb 3.x
Projects
None yet
Development

No branches or pull requests