jaxb-api
jaxb-api copied to clipboard
Mapping of old Java EE artifacts to new Jakarta artifacts
Would be awesome if there were an actual mapping of artifacts from Java EE -> Jakarta EE.
E.g. after hours of looking I am unable to determine how to convert a build that works perfectly well with Java EE XJC, but no idea what the related Jakarta artifacts are.
Specifically having trouble with
- org.jvnet.jaxb2_commons:jaxb2-basics:0.12.0
- org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.12.0
Though I've only gotten this far after hours of trying to track down how to achieve this in Jakarta EE.
have you tried https://github.com/highsource/jaxb2-basics ?
I have.
java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
Here are dependencies I have currently, which seems to be the closest but which leads to that above exception
xjc 'jakarta.xml.bind:jakarta.xml.bind-api:3.0.1'
xjc 'org.glassfish.jaxb:jaxb-runtime:3.0.1'
xjc 'org.jvnet.jaxb2_commons:jaxb2-basics:1.11.1'
xjc 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:1.11.1'
xjc 'org.glassfish.jaxb:jaxb-xjc:3.0.2'
why
xjc 'org.glassfish.jaxb:jaxb-runtime:3.0.1'
xjc 'org.glassfish.jaxb:jaxb-xjc:3.0.2'
are not at the same version? I'm not saying that will help, just that it looks strange to me.
There are two things I'd check/try:
- look at the dependency tree to see which exact version of the
jaxb-xjc
artifact is being used (this artifact has the same packages in javax (2.x) as well as in jakarta (3.x) versions) - try to add
javax.xml.bind:jaxb-api:2.3.1
to your dependencies, that should resolve (hide?) the Error
note that jaxb2-basics (formerly jaxb2-commons project at java.net) has been community driven with no involvement of the jaxb(-ri) team since its beginning - if my memory works well after those ~15 years...
Just an oversight as I have been trying combinations. As you said, no difference.
I know its complicated, but its super frustrating to continually run into these kind of situations trying to migrate to Jakarta EE. Its not like jaxb2-basics
is a super obscure, unused project.
I agree with you. We just have to deal with current situation somehow.... There is that Eclipse Transformer project, some similar alternative from Apache but I don't think they help in this case. An option could be to backport fix for https://github.com/eclipse-ee4j/jaxb-ri/issues/1475 with reverted logic to 2.x version (EE8 branch) - add sth '-target 3.0' to generate 'jakarta'-ready code. The thing is that the code generated by plugins probably won't compile, so one would have to do some post-processing after running xjc. Just thinking loud...
I played around and got a working version of jaxb2-basics. Actually did not really even take much change.
https://github.com/highsource/jaxb2-basics/pull/129
Sorry when highjacking this issue, but there seems to be some expertise here about the topic.
I have projects which use the plugins from https://github.com/javaee/jaxb2-commons together with the Apache CXF XJC Plugin (https://github.com/apache/cxf-xjc-utils/tree/master/cxf-xjc-plugin). The later has been upgraded to JavaEE9 (Jakarta.*) recently. But the last commit in https://github.com/javaee/jaxb2-commons has is dated back to 2017. Is there any successor to this project which I have missed?
Update: The basics plugin in https://github.com/javaee/jaxb2-commons seems to be the predecessor of the Highsource https://github.com/highsource/jaxb2-basics plugin.
I upgraded the other jaxb2-commons plugins in https://github.com/javaee/jaxb2-commons/pull/46. Actually no big changes necessary besides the obvious dependency upgrades.
Hi everyone Currently working with Matt on updating highsource projects for jakarta migration Also did get remaining old plugins into jaxb-basics (issue raised by @cachescrubber )
Keep updated, release will be soon available
Hi everyone Currently working with Matt on updating highsource projects for jakarta migration Also did get remaining old plugins into jaxb-basics (issue raised by @cachescrubber )
Keep updated, release will be soon available
See https://github.com/highsource/jaxb2-basics/pull/167 merged into master