在哪里可以找到Jakarta EE 9或10兼容JAXB参考实现JAR文件?
因此,我有一个使用一些Javax的小JAR应用程序(不在Web容器中运行)。*在JDK8上运行的JAXB类。 现在是升级到JDK17的时候,该JDK17不与Jaxb一起运送。 因此,我认为,很容易,我下载了jaxb的jakarta EE 9(或10)参考实现JAR文件,在代码Javax中切换。 似乎我找不到可以在jakarta EE 9(或10)中下载JAXB的参考实现JAR文件的位置。 所以显然我缺少一些东西。 有人可以指导我解决这个问题吗?
So I have a small JAR application (not running in a web container) that uses some javax.* classes of JAXB running on jdk8.
The time has come to upgrade to jdk17 which does not ship with JAXB.
So I thought,easy enough, I download the jakarta ee 9 (or 10) reference implementation jar files for JAXB, switch in the code javax.* to jakarta.* namespace and we are good to go.
Seems I can't find where I can download the reference implementation jar files for JAXB in jakarta ee 9 (or 10).
So obviously I'm missing something.
Can someone guide me to the good approach to solve this ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我主要使用Maven来处理我的依赖项,但希望这至少有所帮助。
对于JAXB 3.X,您可以使用以下API依赖性,
然后用于实现,您可以使用以下内容。
如果您需要从XSD生成类,则可以使用Jaxb2-Maven-Plugin 3.1.0。它似乎仅取决于jakarta.xml.bind-api,同时将休息作为嵌套依赖关系。
不确定javax.crivation
I mostly use maven to handle my dependencies but hope this helps at least a bit.
For jaxb 3.x you can use following api-dependency
Then for implementation you can use the following.
If you need to generate classes from xsd you can use jaxb2-maven-plugin 3.1.0. It seems to only depend on jakarta.xml.bind-api while including rest as nested dependencies.
Not sure about javax.activation
这与问题无直接相关,但这对于想要更新软件包名称
javax
jakarta
的人可能会有所帮助。如果您有很多项目包含很多课程,那么用替换器将其转换成真是无聊。取而代之的是,您有2个选项:选项1
在您的项目root文件夹中执行Shell脚本,并让脚本自动为您转换。但是,您必须修改Shell脚本以覆盖所有软件包。
您可以在此文章。
选项2
如果您使用的是Intellij Idea,那么您很幸运,有一个按钮可以转换所有软件包。
重构>迁移软件包和类> Java EE到Jakarta EE
请按照上述路径查找选项。
This is not directly related to the question, but it can be helpful for people who wants to update package names
javax
tojakarta
. If you have huge project contains lots of classes, then it will be really boring to convert them with replacer. Instead, you have 2 options:Option 1
Execute shell script in your project root folder and let the script converts automatically for you. However, you have to modify the shell script to cover all the packages.
You can find the script in this article.
Option 2
If you are using Intellij IDEA, then you are lucky, there is a button to convert all packages.
Refactor > Migrate Packages and Classes > Java EE to Jakarta EE
Follow the above path to find the option.